public function GroupRole::grantPermission in Group 2.0.x
Same name and namespace in other branches
- 8 src/Entity/GroupRole.php \Drupal\group\Entity\GroupRole::grantPermission()
Grants a permission to the role.
Parameters
string $permission: The permission to grant.
Return value
\Drupal\group\Entity\GroupRoleInterface The group role this was called on.
Overrides GroupRoleInterface::grantPermission
File
- src/
Entity/ GroupRole.php, line 220
Class
- GroupRole
- Defines the Group role configuration entity.
Namespace
Drupal\group\EntityCode
public function grantPermission($permission) {
return $this
->grantPermissions([
$permission,
]);
}