You are here

public function ChainGroupPermissionCalculator::calculateAuthenticatedPermissions in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Access/ChainGroupPermissionCalculator.php \Drupal\group\Access\ChainGroupPermissionCalculator::calculateAuthenticatedPermissions()

Calculates the full group permissions for an authenticated account.

This includes both outsider and member permissions.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user account for which to retrieve the permissions.

Return value

\Drupal\group\Access\CalculatedGroupPermissionsInterface An object representing the full authenticated group permissions.

Overrides ChainGroupPermissionCalculatorInterface::calculateAuthenticatedPermissions

1 call to ChainGroupPermissionCalculator::calculateAuthenticatedPermissions()
ChainGroupPermissionCalculator::calculatePermissions in src/Access/ChainGroupPermissionCalculator.php
Calculates the full group permissions for an account.

File

src/Access/ChainGroupPermissionCalculator.php, line 269

Class

ChainGroupPermissionCalculator
Collects group permissions for an account.

Namespace

Drupal\group\Access

Code

public function calculateAuthenticatedPermissions(AccountInterface $account) {
  $calculated_permissions = new RefinableCalculatedGroupPermissions();
  $calculated_permissions
    ->merge($this
    ->calculateOutsiderPermissions($account))
    ->merge($this
    ->calculateMemberPermissions($account));
  return new CalculatedGroupPermissions($calculated_permissions);
}