getYamlDiscovery example


  protected function buildPermissionsYaml() {
    $all_permissions = [];
    $all_callback_permissions = [];

    foreach ($this->getYamlDiscovery()->findAll() as $provider => $permissions) {
      // The top-level 'permissions_callback' is a list of methods in controller       // syntax, see \Drupal\Core\Controller\ControllerResolver. These methods       // should return an array of permissions in the same structure.       if (isset($permissions['permission_callbacks'])) {
        foreach ($permissions['permission_callbacks'] as $permission_callback) {
          $callback = $this->controllerResolver->getControllerFromDefinition($permission_callback);
          if ($callback_permissions = call_user_func($callback)) {
            // Add any callback permissions to the array of permissions. Any             // defaults can then get processed below.             foreach ($callback_permissions as $name => $callback_permission) {
              if (!is_array($callback_permission)) {
                
Home | Imprint | This part of the site doesn't use cookies.