Interface IdentityInterface
Interface for describing identities that can have authorization checked.
This interface is similar to the interface defined in cakephp/authentication and uses ArrayAccess to expose public properties of the wrapped identity implementation.
Method Summary
-
applyScope() public
Apply authorization scope conditions/restrictions.
-
can() public
Check whether the current identity can perform an action.
-
canResult() public
Check whether the current identity can perform an action.
-
getOriginalData() public
Get the decorated identity
Method Detail
applyScope() ¶ public
applyScope(string $action, mixed $resource, mixed ...$optionalArgs): mixed
Apply authorization scope conditions/restrictions.
Parameters
-
string
$action The action/operation being performed.
-
mixed
$resource The resource being operated on.
-
mixed
...$optionalArgs Multiple additional arguments which are passed to the scope
Returns
mixed
can() ¶ public
can(string $action, mixed $resource): bool
Check whether the current identity can perform an action.
Parameters
-
string
$action The action/operation being performed.
-
mixed
$resource The resource being operated on.
Returns
bool
canResult() ¶ public
canResult(string $action, mixed $resource): Authorization\Policy\ResultInterface
Check whether the current identity can perform an action.
Parameters
-
string
$action The action/operation being performed.
-
mixed
$resource The resource being operated on.
Returns
Authorization\Policy\ResultInterface
getOriginalData() ¶ public
getOriginalData(): ArrayAccess|array
Get the decorated identity
If the decorated identity implements getOriginalData()
that method should be invoked to expose the original data.
Returns
ArrayAccess|array