function AccessPolicyProcessor::processAccessPolicies
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Session/AccessPolicyProcessor.php \Drupal\Core\Session\AccessPolicyProcessor::processAccessPolicies()
- 10 core/lib/Drupal/Core/Session/AccessPolicyProcessor.php \Drupal\Core\Session\AccessPolicyProcessor::processAccessPolicies()
Processes the access policies for an account within a given scope.
Parameters
\Drupal\Core\Session\AccountInterface $account: The user account for which to calculate the permissions.
string $scope: (optional) The scope to calculate the permissions, defaults to 'drupal'.
Return value
\Drupal\Core\Session\CalculatedPermissionsInterface The access policies' permissions within the given scope.
Overrides AccessPolicyProcessorInterface::processAccessPolicies
File
-
core/
lib/ Drupal/ Core/ Session/ AccessPolicyProcessor.php, line 42
Class
- AccessPolicyProcessor
- Processes access policies into permissions for an account.
Namespace
Drupal\Core\SessionCode
public function processAccessPolicies(AccountInterface $account, string $scope = AccessPolicyInterface::SCOPE_DRUPAL) : CalculatedPermissionsInterface {
if (!\Fiber::getCurrent()) {
return $this->doProcessAccessPolicies($account, $scope);
}
// If running in a fiber, prevent the current user switch from escaping to
// outside the fiber by resuming the fiber if it was suspended.
$fiber = new \Fiber([
$this,
'doProcessAccessPolicies',
]);
$fiber->start($account, $scope);
while (!$fiber->isTerminated()) {
if ($fiber->isSuspended()) {
$resume_type = $fiber->resume();
if (!$fiber->isTerminated() && $resume_type !== FiberResumeType::Immediate) {
usleep(500);
}
}
}
return $fiber->getReturn();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.