common/models/entities/Role.php
public function getPermissionsSlugList() {

		$slugList	= [];
		$idList		= [];

		// TODO: Use roles hierarchy recursively to get child roles

		if( !empty( $this->gridCache ) ) {

			return $this->getGridCacheAttribute( 'permissionsSlugList' );
		}
		else {

			// Generate L0 Slugs and Ids List
			$permissions = $this->permissions;

			foreach( $permissions as $permission ) {

				if( !in_array( $permission->slug, $slugList ) ) {

					array_push( $slugList, $permission->slug );

					if( $permission->group ) {

						array_push( $idList, $permission->id );
					}
				}
			}

			// Add child permission slugs recursively till all leaf nodes get exhausted.
			while( count( $idList ) > 0 ) {

				$permissions = Permission::findGroupPermissions( $idList );

				$idList = [];

				foreach( $permissions as $permission ) {

					if( !in_array( $permission->slug, $slugList ) ) {

						array_push( $slugList, $permission->slug );

						if( $permission->group ) {

							array_push( $idList, $permission->id );
						}
					}
				}

				if( count( $idList ) == 0 ) {

					break;
				}
			};
		}

		return $slugList;
	}
public function getPermissionsSlugList() {

		$slugList	= [];
		$idList		= [];

		// TODO: Use roles hierarchy recursively to get child roles

		if( !empty( $this->gridCache ) ) {

			return $this->getGridCacheAttribute( 'permissionsSlugList' );
		}
		else {

			// Generate L0 Slugs and Ids List
			$permissions = $this->permissions;

			foreach( $permissions as $permission ) {

				if( !in_array( $permission->slug, $slugList ) ) {

					array_push( $slugList, $permission->slug );

					if( $permission->group ) {

						array_push( $idList, $permission->id );
					}
				}
			}

			// Add child permission slugs recursively till all leaf nodes get exhausted.
			while( count( $idList ) > 0 ) {

				$permissions = Permission::findGroupPermissions( $idList );

				$idList = [];

				foreach( $permissions as $permission ) {

					if( !in_array( $permission->slug, $slugList ) ) {

						array_push( $slugList, $permission->slug );

						if( $permission->group ) {

							array_push( $idList, $permission->id );
						}
					}
				}

				if( count( $idList ) == 0 ) {

					break;
				}
			};
		}

		return $slugList;
	}
public function getPermissionsSlugList ( ) { $ slugList = [ ] ; $ idList = [ ] ; // TODO: Use roles hierarchy recursively to get child roles if ( ! empty ( $ this -> gridCache ) ) { return $ this -> getGridCacheAttribute ( 'permissionsSlugList' ) ; } else { // Generate L0 Slugs and Ids List $ permissions = $ this -> permissions ; foreach ( $ permissions as $ permission ) { if ( ! in_array ( $ permission -> slug , $ slugList ) ) { array_push ( $ slugList , $ permission -> slug ) ; if ( $ permission -> group ) { array_push ( $ idList , $ permission -> id ) ; } } } // Add child permission slugs recursively till all leaf nodes get exhausted. while ( count ( $ idList ) > 0 ) { $ permissions = Permission :: findGroupPermissions ( $ idList ) ; $ idList = [ ] ; foreach ( $ permissions as $ permission ) { if ( ! in_array ( $ permission -> slug , $ slugList ) ) { array_push ( $ slugList , $ permission -> slug ) ; if ( $ permission -> group ) { array_push ( $ idList , $ permission -> id ) ; } } } if ( count ( $ idList ) == 0 ) { break ; } } ; } return $ slugList ; }
Generate and return the array having slug of mapped permissions.

@return array
Generate and return the array having slug of mapped permissions .