class Authorisation implements AuthorisationInterface (View source)

The Authorisation class.

Methods

boolean
authorise(string $policy, mixed $user, mixed $data = null)

authorise

addPolicy(string $name, PolicyInterface|callable $handler)

addPolicy

getPolicy(string $name)

getPolicy

boolean
hasPolicy(string $name)

hasPolicy

getPolicies()

Method to get property Policies

setPolicies(PolicyInterface[] $policies)

Method to set property policies

Details

at line line 34
boolean authorise(string $policy, mixed $user, mixed $data = null)

authorise

Parameters

string $policy
mixed $user
mixed $data

Return Value

boolean

at line line 55
AuthorisationInterface addPolicy(string $name, PolicyInterface|callable $handler)

addPolicy

Parameters

string $name
PolicyInterface|callable $handler

Return Value

AuthorisationInterface

at line line 79
PolicyInterface getPolicy(string $name)

getPolicy

Parameters

string $name

Return Value

PolicyInterface

at line line 96
AuthorisationInterface registerPolicyProvider(PolicyProviderInterface $policy)

registerPolicy

Parameters

PolicyProviderInterface $policy

Return Value

AuthorisationInterface

at line line 110
boolean hasPolicy(string $name)

hasPolicy

Parameters

string $name

Return Value

boolean

at line line 120
PolicyInterface[] getPolicies()

Method to get property Policies

Return Value

PolicyInterface[]

at line line 132
Authorisation setPolicies(PolicyInterface[] $policies)

Method to set property policies

Parameters

PolicyInterface[] $policies

Return Value

Authorisation Return self to support chaining.