You are here

public function Group::hasPermission in Group 8

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

Checks whether a user has the requested permission.

Parameters

string $permission: The permission to check for.

\Drupal\Core\Session\AccountInterface $account: The account for which to check a permission.

Return value

bool Whether the user has the requested permission.

Overrides GroupInterface::hasPermission

File

src/Entity/Group.php, line 222

Class

Group
Defines the Group entity.

Namespace

Drupal\group\Entity

Code

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