function CalculatedPermissionsItem::__construct

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Session/CalculatedPermissionsItem.php \Drupal\Core\Session\CalculatedPermissionsItem::__construct()

Constructs a new CalculatedPermissionsItem.

Parameters

string[] $permissions: The permission names.

bool $isAdmin: (optional) Whether the item grants admin privileges.

string $scope: (optional) The scope name, defaults to 'drupal'.

string|int $identifier: (optional) The identifier within the scope, defaults to 'drupal'.

File

core/lib/Drupal/Core/Session/CalculatedPermissionsItem.php, line 24

Class

CalculatedPermissionsItem
Represents a single entry for the calculated permissions.

Namespace

Drupal\Core\Session

Code

public function __construct(array $permissions, bool $isAdmin = FALSE, string $scope = AccessPolicyInterface::SCOPE_DRUPAL, string|int $identifier = AccessPolicyInterface::SCOPE_DRUPAL) {
    $this->permissions = $isAdmin ? [] : array_unique($permissions);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.