You are here

class GroupContentMenuPermissionProvider in Group Content Menu 8

Provide group permissions for group_content_menu entities.

Hierarchy

Expanded class hierarchy of GroupContentMenuPermissionProvider

File

src/Plugin/GroupContentMenuPermissionProvider.php, line 10

Namespace

Drupal\group_content_menu\Plugin
View source
class GroupContentMenuPermissionProvider extends GroupContentPermissionProvider {

  /**
   * {@inheritdoc}
   */
  public function getPermission($operation, $target, $scope = 'any') {

    // Group Content Menus don't operate like normal group content so these
    // permissions don't apply. Instead we use a high-level "Manage menus" perm.
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function buildPermissions() {
    $permissions = [];
    $permissions['access group content menu overview'] = $this
      ->buildPermission('Access group content menu overview', 'Access the overview of all menus');
    $permissions['manage group_content_menu'] = $this
      ->buildPermission('Manage menus', 'Create, update and delete menus');
    return $permissions;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GroupContentHandlerBase::$definition protected property The group content enabler definition.
GroupContentHandlerBase::$moduleHandler protected property The module handler to invoke hooks on.
GroupContentHandlerBase::$pluginId protected property The plugin ID as read from the definition.
GroupContentHandlerBase::moduleHandler protected function Gets the module handler.
GroupContentHandlerBase::setModuleHandler public function Sets the module handler for this handler.
GroupContentHandlerBase::__construct public function Constructs a GroupContentHandlerBase object.
GroupContentMenuPermissionProvider::buildPermissions public function Provides a list of group permissions the plugin exposes. Overrides GroupContentPermissionProvider::buildPermissions
GroupContentMenuPermissionProvider::getPermission public function Gets the name of the permission for the given operation, target and scope. Overrides GroupContentPermissionProvider::getPermission
GroupContentPermissionProvider::$definesEntityPermissions protected property Whether the plugin defines permissions for the target entity type.
GroupContentPermissionProvider::$entityType protected property The entity type the enabler is for.
GroupContentPermissionProvider::$implementsOwnerInterface protected property Whether the target entity type implements the EntityOwnerInterface.
GroupContentPermissionProvider::$implementsPublishedInterface protected property Whether the target entity type implements the EntityPublishedInterface.
GroupContentPermissionProvider::buildPermission protected function Builds a permission with common translation arguments predefined.
GroupContentPermissionProvider::createInstance public static function Instantiates a new instance of this group content handler. Overrides GroupContentHandlerBase::createInstance
GroupContentPermissionProvider::getAdminPermission public function Gets the name of the admin permission. Overrides GroupContentPermissionProviderInterface::getAdminPermission
GroupContentPermissionProvider::getEntityCreatePermission public function Gets the name of the create permission for the relation. Overrides GroupContentPermissionProviderInterface::getEntityCreatePermission
GroupContentPermissionProvider::getEntityDeletePermission public function Gets the name of the delete permission for the relation. Overrides GroupContentPermissionProviderInterface::getEntityDeletePermission
GroupContentPermissionProvider::getEntityUpdatePermission public function Gets the name of the update permission for the relation. Overrides GroupContentPermissionProviderInterface::getEntityUpdatePermission
GroupContentPermissionProvider::getEntityViewPermission public function Gets the name of the view permission for the relation. Overrides GroupContentPermissionProviderInterface::getEntityViewPermission 1
GroupContentPermissionProvider::getEntityViewUnpublishedPermission public function Gets the name of the view unpublished permission for the relation. Overrides GroupContentPermissionProviderInterface::getEntityViewUnpublishedPermission 2
GroupContentPermissionProvider::getRelationCreatePermission public function Gets the name of the create permission for the relation. Overrides GroupContentPermissionProviderInterface::getRelationCreatePermission 1
GroupContentPermissionProvider::getRelationDeletePermission public function Gets the name of the delete permission for the relation. Overrides GroupContentPermissionProviderInterface::getRelationDeletePermission 1
GroupContentPermissionProvider::getRelationUpdatePermission public function Gets the name of the update permission for the relation. Overrides GroupContentPermissionProviderInterface::getRelationUpdatePermission 1
GroupContentPermissionProvider::getRelationViewPermission public function Gets the name of the view permission for the relation. Overrides GroupContentPermissionProviderInterface::getRelationViewPermission