public function GroupMembership::hasPermission in Group 8
Same name and namespace in other branches
- 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\groupCode
public function hasPermission($permission) {
return $this
->groupPermissionChecker()
->hasPermissionInGroup($permission, $this
->getUser(), $this
->getGroup());
}