public function listAllowedByClass($resourceClass, string $action = ''): array
    {
        $permissions = $this->groupPermissions->getResourcePermissionsByClass($resourceClass);
        $permitted = [];
        foreach ($permissions as $permission) {
            if (!$action || $permission->can($action)) {
                $permitted[] = $permission->getResourceId();
            }
        }

        return array_unique($permitted);
    }
public function listAllowedByClass($resourceClass, string $action = ''): array
    {
        $permissions = $this->groupPermissions->getResourcePermissionsByClass($resourceClass);
        $permitted = [];
        foreach ($permissions as $permission) {
            if (!$action || $permission->can($action)) {
                $permitted[] = $permission->getResourceId();
            }
        }

        return array_unique($permitted);
    }
public function listAllowedByClass ( $ resourceClass , string $ action = '' ) : array { $ permissions = $ this -> groupPermissions -> getResourcePermissionsByClass ( $ resourceClass ) ; $ permitted = [ ] ; foreach ( $ permissions as $ permission ) { if ( ! $ action || $ permission -> can ( $ action ) ) { $ permitted [ ] = $ permission -> getResourceId ( ) ; } } return array_unique ( $ permitted ) ; }
List allowed resource IDs by class

@param $resourceClass
@param $action

@return array Array of IDs whose class was $resourceClass
List allowed resource IDs by class