You are here

public function GroupRole::hasPermission in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/GroupRole.php \Drupal\group\Entity\GroupRole::hasPermission()

Checks if the role has a permission.

Parameters

string $permission: The permission to check for.

Return value

bool TRUE if the role has the permission, FALSE if not.

Overrides GroupRoleInterface::hasPermission

File

src/Entity/GroupRole.php, line 213

Class

GroupRole
Defines the Group role configuration entity.

Namespace

Drupal\group\Entity

Code

public function hasPermission($permission) {
  return in_array($permission, $this->permissions);
}