ServicePrincipalRolesTable
extends BaseTable
in package
ServicePrincipalRoles Table - Role Assignments for Service Principals
Mirrors MemberRoles structure for API client RBAC.
Table of Contents
Constants
- CACHE_GROUPS_TO_CLEAR = []
- CACHES_TO_CLEAR = []
- ID_CACHES_TO_CLEAR = []
Properties
- $ApprovedBy : MembersTable|BelongsTo
- $Branches : BranchesTable|BelongsTo
- $RevokedBy : MembersTable|BelongsTo
- $Roles : RolesTable|BelongsTo
- $ServicePrincipals : ServicePrincipalsTable|BelongsTo
Methods
- addBranchScopeQuery() : SelectQuery
- Add branch-based data scoping to a query.
- afterDelete() : void
- After delete hook to capture impersonation audit trail entries.
- afterSave() : void
- Clear cached permissions after save.
- buildRules() : RulesChecker
- Returns a rules checker object.
- findCurrent() : SelectQuery
- Find current (active) role assignments.
- findOrCreate() : ServicePrincipalRole
- get() : ServicePrincipalRole
- initialize() : void
- Initialize method
- newEmptyEntity() : ServicePrincipalRole
- newEntity() : ServicePrincipalRole
- patchEntity() : ServicePrincipalRole
- save() : ServicePrincipalRole|false
- saveOrFail() : ServicePrincipalRole
- validationDefault() : Validator
- Default validation rules.
- logImpersonationAction() : void
- Record impersonated writes to audit log table.
Constants
CACHE_GROUPS_TO_CLEAR
protected
array<string|int, string>
CACHE_GROUPS_TO_CLEAR
= []
Cache groups to clear entirely on save
CACHES_TO_CLEAR
protected
array<string|int, array{string, string}>
CACHES_TO_CLEAR
= []
Static cache entries to clear on save
ID_CACHES_TO_CLEAR
protected
array<string|int, array{string, string}>
ID_CACHES_TO_CLEAR
= []
Entity-ID cache prefixes to clear on save
Properties
$ApprovedBy
public
MembersTable|BelongsTo
$ApprovedBy
$Branches
public
BranchesTable|BelongsTo
$Branches
$RevokedBy
public
MembersTable|BelongsTo
$RevokedBy
$Roles
public
RolesTable|BelongsTo
$Roles
$ServicePrincipals
public
ServicePrincipalsTable|BelongsTo
$ServicePrincipals
Methods
addBranchScopeQuery()
Add branch-based data scoping to a query.
public
addBranchScopeQuery(SelectQuery $query, array<string|int, int> $branchIDs) : SelectQuery
Child tables should override for custom branch relationships.
Parameters
- $query : SelectQuery
-
The query to modify
- $branchIDs : array<string|int, int>
-
Authorized branch IDs
Return values
SelectQuery —Query with branch filtering
afterDelete()
After delete hook to capture impersonation audit trail entries.
public
afterDelete(EventInterface $event, EntityInterface $entity, ArrayObject $options) : void
Parameters
- $event : EventInterface
-
Delete event
- $entity : EntityInterface
-
Entity being deleted
- $options : ArrayObject
-
Delete options
afterSave()
Clear cached permissions after save.
public
afterSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) : void
Parameters
- $event : EventInterface
-
Event
- $entity : EntityInterface
-
Entity
- $options : ArrayObject
-
Options
buildRules()
Returns a rules checker object.
public
buildRules(RulesChecker $rules) : RulesChecker
Parameters
- $rules : RulesChecker
-
The rules object
Return values
RulesCheckerfindCurrent()
Find current (active) role assignments.
public
findCurrent(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
Query
Return values
SelectQueryfindOrCreate()
public
findOrCreate(mixed $search[, callable|null $callback = = 'null' ][, array<string|int, mixed> $options = = '[]' ]) : ServicePrincipalRole
Parameters
- $search : mixed
- $callback : callable|null = = 'null'
- $options : array<string|int, mixed> = = '[]'
Return values
ServicePrincipalRoleget()
public
get(mixed $primaryKey[, array<string|int, mixed>|string $finder = = '\'all\'' ][, CacheInterface|string|null $cache = = 'null' ][, Closure|string|null $cacheKey = = 'null' ], mixed ...$args) : ServicePrincipalRole
Parameters
- $primaryKey : mixed
- $finder : array<string|int, mixed>|string = = '\'all\''
- $cache : CacheInterface|string|null = = 'null'
- $cacheKey : Closure|string|null = = 'null'
- $args : mixed
Return values
ServicePrincipalRoleinitialize()
Initialize method
public
initialize(array<string, mixed> $config) : void
Parameters
- $config : array<string, mixed>
-
Configuration
newEmptyEntity()
public
newEmptyEntity() : ServicePrincipalRole
Return values
ServicePrincipalRolenewEntity()
public
newEntity(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : ServicePrincipalRole
Parameters
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
ServicePrincipalRolepatchEntity()
public
patchEntity(EntityInterface $entity, array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : ServicePrincipalRole
Parameters
- $entity : EntityInterface
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
ServicePrincipalRolesave()
public
save(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : ServicePrincipalRole|false
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
ServicePrincipalRole|falsesaveOrFail()
public
saveOrFail(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : ServicePrincipalRole
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
ServicePrincipalRolevalidationDefault()
Default validation rules.
public
validationDefault(Validator $validator) : Validator
Parameters
- $validator : Validator
-
Validator instance
Return values
ValidatorlogImpersonationAction()
Record impersonated writes to audit log table.
protected
logImpersonationAction(string $defaultOperation, EntityInterface $entity) : void
Parameters
- $defaultOperation : string
-
Operation fallback (save/delete)
- $entity : EntityInterface
-
Affected entity