original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: List allowed resource IDs by class
  
  @param $resourceClass
  @param $action
  
  @return array Array of IDs whose class was $resourceClass
docstring_tokens: List allowed resource IDs by class