BestowalPolicy
extends BasePolicy
in package
Authorization policy for Bestowal entities in the Awards plugin.
Tags
Table of Contents
Methods
- before() : bool|null
- Check if $user is a super user and can skip auth with an auto True
- canAccessCrownFields() : bool
- Check whether the user may access Crown-only bestowal fields.
- canAccessHeraldNotes() : bool
- Check whether the user may access herald notes.
- canAdd() : bool
- Check if $user can add RolesPermissions
- canAddNote() : bool
- Authorize adding shared notes to a bestowal.
- canAdHoc() : bool
- Authorize ad-hoc bestowal creation.
- canAssignRequiredTodoCourtSlot() : bool
- Authorize assigning the court slot required by an eligible Added to Agenda to-do.
- canAssignRequiredTodoGathering() : bool
- Authorize assigning the gathering required by an eligible Event Scheduled to-do.
- canBulkAssignGathering() : bool
- Authorize bulk gathering assignment for bestowals.
- canCancel() : bool
- Authorize bestowal cancellation.
- canCourtSlotsForGathering() : bool
- Authorize court-slot lookup data used by bestowal edit forms.
- canDelete() : bool
- Check if $user can delete RolesPermissions
- canEdit() : bool
- Check if $user can edit RolesPermissions
- canGatheringBestowalsGridData() : bool
- Authorize gathering-scoped bestowal grid data.
- canGatheringsForBestowalAutoComplete() : bool
- Authorize gathering autocomplete used by single bestowal edit forms and the approval Respond modal.
- canGridData() : bool
- Check if $user can view role
- canIndex() : bool
- Check if $user can view role
- canManageCourtSchedule() : bool
- Check if user can manage court schedule for bestowals.
- canPrepareScrolls() : bool
- Check if user can prepare scrolls for bestowals.
- canTurboEditForm() : bool
- Authorize single bestowal edit modal loading.
- canUpdateState() : bool
- Authorize single bestowal state updates.
- canView() : bool
- Check if $user can view RolesPermissions
- canViewGatheringBestowals() : bool
- Check if user can view bestowals for a specific gathering.
- canViewHidden() : bool
- Check if user can view hidden bestowal states.
- 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.
- isPendingApproverForRecommendation() : bool
- Whether the member is an eligible approver on a pending approval for a recommendation.
- actionItemRequiresCourtSlot() : bool
- Whether the action item carries, or defaults to, the bestowal court slot requirement.
- actionItemRequiresField() : bool
- actionItemRequiresGathering() : bool
- Whether the action item carries, or defaults to, the bestowal gathering requirement.
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|nullcanAccessCrownFields()
Check whether the user may access Crown-only bestowal fields.
public
canAccessCrownFields(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanAccessHeraldNotes()
Check whether the user may access herald notes.
public
canAccessHeraldNotes(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanAdd()
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
boolcanAddNote()
Authorize adding shared notes to a bestowal.
public
canAddNote(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canAdHoc()
Authorize ad-hoc bestowal creation.
public
canAdHoc(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canAssignRequiredTodoCourtSlot()
Authorize assigning the court slot required by an eligible Added to Agenda to-do.
public
canAssignRequiredTodoCourtSlot(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context; first arg is the action item
Return values
bool —True if authorized
canAssignRequiredTodoGathering()
Authorize assigning the gathering required by an eligible Event Scheduled to-do.
public
canAssignRequiredTodoGathering(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context; first arg is the action item
Return values
bool —True if authorized
canBulkAssignGathering()
Authorize bulk gathering assignment for bestowals.
public
canBulkAssignGathering(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canCancel()
Authorize bestowal cancellation.
public
canCancel(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canCourtSlotsForGathering()
Authorize court-slot lookup data used by bestowal edit forms.
public
canCourtSlotsForGathering(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canDelete()
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
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanGatheringBestowalsGridData()
Authorize gathering-scoped bestowal grid data.
public
canGatheringBestowalsGridData(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canGatheringsForBestowalAutoComplete()
Authorize gathering autocomplete used by single bestowal edit forms and the approval Respond modal.
public
canGatheringsForBestowalAutoComplete(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Besides bestowal editors and court schedulers, a member who is currently
an eligible approver on a pending approval for the recommendation carried
in approval_context_recommendation_id may use the lookup — the approval
modal's Bestowal Gathering field is theirs to fill.
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canGridData()
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
boolcanIndex()
Check if $user can view role
public
canIndex(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity|Table
- $optionalArgs : mixed
Return values
boolcanManageCourtSchedule()
Check if user can manage court schedule for bestowals.
public
canManageCourtSchedule(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canPrepareScrolls()
Check if user can prepare scrolls for bestowals.
public
canPrepareScrolls(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canTurboEditForm()
Authorize single bestowal edit modal loading.
public
canTurboEditForm(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canUpdateState()
Authorize single bestowal state updates.
public
canUpdateState(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canView()
Check if $user can view RolesPermissions
public
canView(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanViewGatheringBestowals()
Check if user can view bestowals for a specific gathering.
public
canViewGatheringBestowals(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$args) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $args : mixed
-
Additional authorization context (typically gathering entity)
Return values
bool —True if authorized
canViewHidden()
Check if user can view hidden bestowal states.
public
canViewHidden(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $entity : BaseEntity
-
The bestowal entity
- $optionalArgs : mixed
-
Additional authorization context
Return values
bool —True if authorized
canViewPrivateNotes()
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
boolisPendingApproverForRecommendation()
Whether the member is an eligible approver on a pending approval for a recommendation.
protected
isPendingApproverForRecommendation(KmpIdentityInterface $user, int $recommendationId) : bool
Parameters
- $user : KmpIdentityInterface
-
The authenticated user
- $recommendationId : int
-
Recommendation ID from the lookup context
Return values
boolactionItemRequiresCourtSlot()
Whether the action item carries, or defaults to, the bestowal court slot requirement.
private
actionItemRequiresCourtSlot(ActionItem $item) : bool
Parameters
- $item : ActionItem
-
Action item
Return values
boolactionItemRequiresField()
private
actionItemRequiresField(ActionItem $item, string $requiredField) : bool
Parameters
- $item : ActionItem
-
Action item
- $requiredField : string
-
Required field key
Return values
boolactionItemRequiresGathering()
Whether the action item carries, or defaults to, the bestowal gathering requirement.
private
actionItemRequiresGathering(ActionItem $item) : bool
Parameters
- $item : ActionItem
-
Action item