CourtAgendaPolicy
extends BasePolicy
in package
Authorization policy for Awards court agendas.
Table of Contents
Methods
- before() : bool|null
- Check if $user is a super user and can skip auth with an auto True
- canAdd() : bool
- Check if $user can add RolesPermissions
- canAddBestowal() : bool
- canAddBlock() : bool
- canAddSegment() : bool
- canDelete() : bool
- Check if $user can delete RolesPermissions
- canEdit() : bool
- Check if $user can edit RolesPermissions
- canGathering() : bool
- canGridData() : bool
- Check if $user can view role
- canImport() : bool
- canIndex() : bool
- Check if $user can view role
- canMoveItem() : bool
- canMoveToRoaming() : bool
- canPrintAgenda() : bool
- canRemoveItem() : bool
- canUpdateItem() : bool
- canView() : bool
- Check if $user can view RolesPermissions
- canViewPrivateNotes() : bool
- Check if $user can view hidden
- scopeIndex() : mixed
- Apply scope for index action.
- _getBranchIdsForPolicy() : array<string|int, mixed>|null
- Check if $user can view hidden
- _getPermissions() : bool
- Check if $user can view hidden
- _getPolicies() : bool
- Check if $user can view hidden
- _grantSourceIncludesBranch() : bool
- Check whether a matching source grants the requested branch.
- _hasPolicy() : bool
- Check if $user can view hidden
- _hasPolicyForUrl() : bool
- Check if $user can view hidden
- _isSuperUser() : bool
- Check if $user is a super user
- _matchesGrantSource() : bool
- Check whether a policy method was granted by a compatible source entity.
- hasScopedAgendaPolicy() : bool
- Authorize an agenda by its host branch or by an in-scope award at the gathering.
Methods
before()
Check if $user is a super user and can skip auth with an auto True
public
before(KmpIdentityInterface $user, mixed $resource, string $action) : bool|null
Parameters
- $user : KmpIdentityInterface
-
The user.
- $resource : mixed
-
The resource.
- $action : string
-
The action.
Return values
bool|nullcanAdd()
Check if $user can add RolesPermissions
public
canAdd(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity|Table
- $optionalArgs : mixed
Return values
boolcanAddBestowal()
public
canAddBestowal(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanAddBlock()
public
canAddBlock(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanAddSegment()
public
canAddSegment(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanDelete()
Check if $user can delete RolesPermissions
public
canDelete(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanEdit()
Check if $user can edit RolesPermissions
public
canEdit(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanGathering()
public
canGathering(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanGridData()
Check if $user can view role
public
canGridData(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanImport()
public
canImport(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanIndex()
Check if $user can view role
public
canIndex(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanMoveItem()
public
canMoveItem(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanMoveToRoaming()
public
canMoveToRoaming(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanPrintAgenda()
public
canPrintAgenda(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanRemoveItem()
public
canRemoveItem(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanUpdateItem()
public
canUpdateItem(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
User.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.
Return values
boolcanView()
Check if $user can view RolesPermissions
public
canView(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity|Table
- $optionalArgs : mixed
Return values
boolcanViewPrivateNotes()
Check if $user can view hidden
public
canViewPrivateNotes(KmpIdentityInterface $user, BaseEntity $entity) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
Return values
boolscopeIndex()
Apply scope for index action.
public
scopeIndex(KmpIdentityInterface $user, mixed $query) : mixed
Parameters
- $user : KmpIdentityInterface
- $query : mixed
_getBranchIdsForPolicy()
Check if $user can view hidden
protected
_getBranchIdsForPolicy(KmpIdentityInterface $user, string $policyMethod) : array<string|int, mixed>|null
Parameters
- $user : KmpIdentityInterface
-
The user.
- $policyMethod : string
Return values
array<string|int, mixed>|null_getPermissions()
Check if $user can view hidden
protected
_getPermissions(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
Return values
bool_getPolicies()
Check if $user can view hidden
protected
_getPolicies(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
Return values
bool_grantSourceIncludesBranch()
Check whether a matching source grants the requested branch.
protected
_grantSourceIncludesBranch(object $source, int|null $branchId) : bool
Parameters
- $source : object
-
Matching grant source
- $branchId : int|null
-
Branch context for the authorization check
Return values
bool_hasPolicy()
Check if $user can view hidden
protected
_hasPolicy(KmpIdentityInterface $user, string $policyMethod, BaseEntity|Table $entity[, int|null $branchId = null ][, mixed $grantSource = null ]) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $policyMethod : string
- $entity : BaseEntity|Table
- $branchId : int|null = null
- $grantSource : mixed = null
Return values
bool_hasPolicyForUrl()
Check if $user can view hidden
protected
_hasPolicyForUrl(KmpIdentityInterface $user, string $policyMethod, array<string|int, mixed> $urlProps[, int|null $branchId = null ][, mixed $grantSource = null ]) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $policyMethod : string
- $urlProps : array<string|int, mixed>
- $branchId : int|null = null
- $grantSource : mixed = null
Return values
bool_isSuperUser()
Check if $user is a super user
protected
_isSuperUser(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
Return values
bool_matchesGrantSource()
Check whether a policy method was granted by a compatible source entity.
protected
_matchesGrantSource(object $policyMethodData, object $grantSource[, int|null $branchId = null ]) : bool
Parameters
- $policyMethodData : object
-
Policy method authorization data
- $grantSource : object
-
Source entity being checked
- $branchId : int|null = null
-
Branch context for the authorization check
Return values
boolhasScopedAgendaPolicy()
Authorize an agenda by its host branch or by an in-scope award at the gathering.
private
hasScopedAgendaPolicy(KmpIdentityInterface $user, string $policyMethod, BaseEntity $entity, mixed ...$optionalArgs) : bool
Court agenda staff follow award ownership scope, while gatherings may be hosted by a different branch. A matching bestowal lets those staff manage the shared agenda without widening their permission to unrelated gatherings.
Parameters
- $user : KmpIdentityInterface
-
User.
- $policyMethod : string
-
Policy method.
- $entity : BaseEntity
-
Agenda entity.
- $optionalArgs : mixed
-
Context.