Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PermissionHandler.php

function PermissionHandler::moduleProvidesPermissions

File

core/modules/user/src/PermissionHandler.php, line 124

Class

PermissionHandler
Provides the available permissions based on yml files.

Namespace

Drupal\user

Code

public function moduleProvidesPermissions($module_name) {
    // @todo Static cache this information.
    //   https://www.drupal.org/node/2339487
    $permissions = $this->getPermissions();
    foreach ($permissions as $permission) {
        if ($permission['provider'] == $module_name) {
            return TRUE;
        }
    }
    return FALSE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal