GatheringWaiversControllerPolicy
extends BasePolicy
in package
GatheringWaivers Controller Authorization Policy
Provides URL-based authorization for GatheringWaiversController actions. Includes support for stewards who can access waiver upload and pending waiver actions for gatherings they manage.
Tags
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
- canCalendarData() : ResultInterface|bool
- Check if user can access calendarData action
- canChangeActivities() : ResultInterface|bool
- Check if user can access changeActivities action
- canChangeWaiverType() : ResultInterface|bool
- Check if user can access changeWaiverType action
- canDashboard() : ResultInterface|bool
- Check if user can access dashboard action
- canDelete() : bool
- Check if $user can delete RolesPermissions
- canEdit() : bool
- Check if $user can edit RolesPermissions
- canGridData() : bool
- Check if $user can view role
- canIndex() : bool
- Check if $user can view role
- canMobileSelectGathering() : ResultInterface|bool
- Check if user can access mobileSelectGathering action
- canMobileUpload() : ResultInterface|bool
- Check if user can access mobileUpload action
- canNeedingWaivers() : ResultInterface|bool
- Check if user can access needingWaivers action
- canUpload() : ResultInterface|bool
- Check if user can access upload action
- 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
- _hasPolicy() : bool
- Check if $user can view hidden
- _hasPolicyForUrl() : bool
- Check if $user can view hidden
- _isAnySteward() : bool
- Check if user is a steward for any gathering
- _isSuperUser() : bool
- Check if $user is a super user
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
boolcanCalendarData()
Check if user can access calendarData action
public
canCalendarData(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
canChangeActivities()
Check if user can access changeActivities action
public
canChangeActivities(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
canChangeWaiverType()
Check if user can access changeWaiverType action
public
canChangeWaiverType(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
canDashboard()
Check if user can access dashboard action
public
canDashboard(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Determines if the user can view the comprehensive waiver secretary dashboard. This provides access to waiver statistics, compliance overview, and administrative tools for managing waivers across all accessible branches.
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
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
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
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
boolcanMobileSelectGathering()
Check if user can access mobileSelectGathering action
public
canMobileSelectGathering(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Stewards can access mobile gathering selection for waiver uploads.
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
canMobileUpload()
Check if user can access mobileUpload action
public
canMobileUpload(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Stewards can access mobile waiver upload for their gatherings.
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
canNeedingWaivers()
Check if user can access needingWaivers action
public
canNeedingWaivers(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Determines if the user can view the list of gatherings that need waivers. This action shows gatherings where the user has permission to upload waivers and required waivers are missing.
Stewards can access this action if they are a steward for at least one non-closed gathering.
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
canUpload()
Check if user can access upload action
public
canUpload(KmpIdentityInterface $user, array<string|int, mixed> $urlProps) : ResultInterface|bool
Parameters
- $user : KmpIdentityInterface
-
User identity
- $urlProps : array<string|int, mixed>
-
URL properties for the action
Return values
ResultInterface|bool —Authorization result
canView()
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_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_isAnySteward()
Check if user is a steward for any gathering
protected
_isAnySteward(KmpIdentityInterface $user[, bool $checkClosure = false ]) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $checkClosure : bool = false
-
If true, only counts non-closed gatherings
Return values
bool —True if user is a steward for at least one qualifying gathering
_isSuperUser()
Check if $user is a super user
protected
_isSuperUser(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.