KmpIdentityInterface
extends
IdentityInterface
in
Table of Contents
Methods
- checkCan() : bool
- Check if the user has a specific permission
- getAsMember() : Member
- Get the identity as a Member entity.
- getIdentifier() : array<string|int, mixed>|string|int|null
- Get identifier.
- getPermissionIDs() : array<string|int, int>
- Get permission IDs for the Member based on their roles
- getPermissions() : array<string|int, Permission>
- Get permissions for the Member based on their roles
- getPolicies() : array<string|int, mixed>
- Get policies for the Member based on their roles and optionally filtered by branch IDs
- isSuperUser() : bool
- Check if one of the users roles grants them super user
- setAuthorization() : self
- sets the authorization service.
Methods
checkCan()
Check if the user has a specific permission
public
checkCan(string $action, mixed $resource, mixed ...$optionalArgs) : bool
Parameters
- $action : string
-
The action/operation being performed.
- $resource : mixed
-
The resource being operated on.
- $optionalArgs : mixed
-
Optional arguments
Return values
boolgetAsMember()
Get the identity as a Member entity.
public
getAsMember() : Member
Return values
MembergetIdentifier()
Get identifier.
public
getIdentifier() : array<string|int, mixed>|string|int|null
Return values
array<string|int, mixed>|string|int|nullgetPermissionIDs()
Get permission IDs for the Member based on their roles
public
getPermissionIDs() : array<string|int, int>
Return values
array<string|int, int>getPermissions()
Get permissions for the Member based on their roles
public
getPermissions() : array<string|int, Permission>
Return values
array<string|int, Permission>getPolicies()
Get policies for the Member based on their roles and optionally filtered by branch IDs
public
getPolicies([array<string|int, int>|null $branchIds = null ]) : array<string|int, mixed>
Parameters
- $branchIds : array<string|int, int>|null = null
-
Optional array of branch IDs to filter policies
Return values
array<string|int, mixed>isSuperUser()
Check if one of the users roles grants them super user
public
isSuperUser() : bool
Return values
boolsetAuthorization()
sets the authorization service.
public
setAuthorization(AuthorizationServiceInterface $auth) : self
Parameters
- $auth : AuthorizationServiceInterface