Loading core/lib/Drupal/Core/Session/AccessPolicyBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ public function applies(string $scope): bool { /** * {@inheritdoc} */ public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { return (new RefinableCalculatedPermissions())->addCacheContexts($this->getPersistentCacheContexts()); } Loading core/lib/Drupal/Core/Session/AccessPolicyInterface.php +2 −2 Original line number Diff line number Diff line Loading @@ -42,10 +42,10 @@ public function applies(string $scope): bool; * @param string $scope * The scope to calculate the permissions for. * * @return \Drupal\Core\Session\CalculatedPermissionsInterface * @return \Drupal\Core\Session\RefinableCalculatedPermissionsInterface * An object representing the permissions within the given scope. */ public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface; public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface; /** * Alter the permissions after all policies have finished building them. Loading core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php +4 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ use Drupal\Core\Session\AccessPolicyProcessor; use Drupal\Core\Session\AccessPolicyScopeException; use Drupal\Core\Session\CalculatedPermissions; use Drupal\Core\Session\CalculatedPermissionsInterface; use Drupal\Core\Session\CalculatedPermissionsItem; use Drupal\Core\Session\RefinableCalculatedPermissions; use Drupal\Core\Session\RefinableCalculatedPermissionsInterface; Loading Loading @@ -427,7 +426,7 @@ public function applies(string $scope): bool { return $scope === 'foo' || $scope === 'anything'; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['foo', 'bar'], TRUE, $scope, 1)); } Loading @@ -444,7 +443,7 @@ public function applies(string $scope): bool { return $scope === 'bar' || $scope === 'anything'; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['foo', 'bar'], FALSE, $scope, 1)); } Loading @@ -461,7 +460,7 @@ public function applies(string $scope): bool { return $scope === 'baz'; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['baz'], FALSE, 'baz', 1)); } Loading Loading @@ -507,7 +506,7 @@ public function applies(string $scope): bool { return TRUE; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['always'], FALSE, 'always', 1)); } Loading Loading
core/lib/Drupal/Core/Session/AccessPolicyBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ public function applies(string $scope): bool { /** * {@inheritdoc} */ public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { return (new RefinableCalculatedPermissions())->addCacheContexts($this->getPersistentCacheContexts()); } Loading
core/lib/Drupal/Core/Session/AccessPolicyInterface.php +2 −2 Original line number Diff line number Diff line Loading @@ -42,10 +42,10 @@ public function applies(string $scope): bool; * @param string $scope * The scope to calculate the permissions for. * * @return \Drupal\Core\Session\CalculatedPermissionsInterface * @return \Drupal\Core\Session\RefinableCalculatedPermissionsInterface * An object representing the permissions within the given scope. */ public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface; public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface; /** * Alter the permissions after all policies have finished building them. Loading
core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php +4 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ use Drupal\Core\Session\AccessPolicyProcessor; use Drupal\Core\Session\AccessPolicyScopeException; use Drupal\Core\Session\CalculatedPermissions; use Drupal\Core\Session\CalculatedPermissionsInterface; use Drupal\Core\Session\CalculatedPermissionsItem; use Drupal\Core\Session\RefinableCalculatedPermissions; use Drupal\Core\Session\RefinableCalculatedPermissionsInterface; Loading Loading @@ -427,7 +426,7 @@ public function applies(string $scope): bool { return $scope === 'foo' || $scope === 'anything'; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['foo', 'bar'], TRUE, $scope, 1)); } Loading @@ -444,7 +443,7 @@ public function applies(string $scope): bool { return $scope === 'bar' || $scope === 'anything'; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['foo', 'bar'], FALSE, $scope, 1)); } Loading @@ -461,7 +460,7 @@ public function applies(string $scope): bool { return $scope === 'baz'; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['baz'], FALSE, 'baz', 1)); } Loading Loading @@ -507,7 +506,7 @@ public function applies(string $scope): bool { return TRUE; } public function calculatePermissions(AccountInterface $account, string $scope): CalculatedPermissionsInterface { public function calculatePermissions(AccountInterface $account, string $scope): RefinableCalculatedPermissionsInterface { $calculated_permissions = parent::calculatePermissions($account, $scope); return $calculated_permissions->addItem(new CalculatedPermissionsItem(['always'], FALSE, 'always', 1)); } Loading