You are here

public function Dummy::getProposals in Authorization 8

Get the proposals for this users.

Parameters

\Drupal\user\UserInterface $user: The user to act upon.

Return value

array Relevant proposals.

Overrides ProviderInterface::getProposals

File

tests/modules/authorization_test/src/Plugin/authorization/Provider/Dummy.php, line 24

Class

Dummy
The LDAP authorization provider for authorization module.

Namespace

Drupal\authorization_test\Plugin\authorization\Provider

Code

public function getProposals(UserInterface $user) : array {
  foreach ($user->proposals as $proposal) {
    if ($proposal === 'exception') {
      throw new AuthorizationSkipAuthorization('Skip');
    }
  }
  return $user->proposals;
}