You are here

public function GroupMembership::hasPermission in Group 8

Same name and namespace in other branches
  1. 2.0.x src/GroupMembership.php \Drupal\group\GroupMembership::hasPermission()

Checks whether the member has a permission.

Parameters

string $permission: The permission to check for.

Return value

bool Whether the member has the requested permission.

File

src/GroupMembership.php, line 90

Class

GroupMembership
Wrapper class for a GroupContent entity representing a membership.

Namespace

Drupal\group

Code

public function hasPermission($permission) {
  return $this
    ->groupPermissionChecker()
    ->hasPermissionInGroup($permission, $this
    ->getUser(), $this
    ->getGroup());
}