You are here

public function GroupPermission::setApplicableRoles in Organic groups 8

Returns the roles to which this permission can be applied.

For example, the 'subscribe' permission only applies to non-members.

Parameters

array $roles: An array of roles to which this permission applies. If empty, the permission applies to all roles.

Return value

$this

File

src/GroupPermission.php, line 49

Class

GroupPermission
A group level permission.

Namespace

Drupal\og

Code

public function setApplicableRoles(array $roles) {
  $this
    ->set('roles', $roles);
  return $this;
}