You are here

public function GroupMembershipPermissionProvider::getRelationDeletePermission in Group 8

Gets the name of the delete permission for the relation.

Parameters

string $scope: (optional) Whether the 'any' or 'own' permission name should be returned. Defaults to 'any'.

Return value

string|false The permission name or FALSE if it does not apply.

Overrides GroupContentPermissionProvider::getRelationDeletePermission

File

src/Plugin/GroupMembershipPermissionProvider.php, line 24

Class

GroupMembershipPermissionProvider
Provides group permissions for group_membership GroupContent entities.

Namespace

Drupal\group\Plugin

Code

public function getRelationDeletePermission($scope = 'any') {

  // Delete any is handled by the admin permission.
  if ($scope === 'own') {
    return 'leave group';
  }
  return FALSE;
}