KMP PHP API Reference

KmpIdentityInterface extends IdentityInterface

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
bool

getIdentifier()

Get identifier.

public getIdentifier() : array<string|int, mixed>|string|int|null
Return values
array<string|int, mixed>|string|int|null

getPermissionIDs()

Get permission IDs for the Member based on their roles

public getPermissionIDs() : array<string|int, int>
Return values
array<string|int, int>

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
bool

setAuthorization()

sets the authorization service.

public setAuthorization(AuthorizationServiceInterface $auth) : self
Parameters
$auth : AuthorizationServiceInterface
Return values
self

        
On this page

Search results