You are here

public function ProtectionRule::setBypassRoles in User protect 8

Sets the list of roles that may bypass this protection rule.

Parameters

array $roles: The roles that may bypass this protection rule.

Return value

\Drupal\userprotect\Entity\ProtectionRuleInterface The called protection rule entity.

Overrides ProtectionRuleInterface::setBypassRoles

File

src/Entity/ProtectionRule.php, line 276

Class

ProtectionRule
Defines the Protection rule entity.

Namespace

Drupal\userprotect\Entity

Code

public function setBypassRoles(array $roles) {
  $this->bypassRoles = $roles;
  return $this;
}