You are here

public function GroupRole::hasPermission in Group 8

Same name and namespace in other branches
  1. 2.0.x 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);
}