KMP PHP API Reference

WaiverTypePolicy extends BasePolicy
in package

WaiverType Policy

Manages authorization for waiver type operations. Authorization is driven by the Roles → Permissions → Policies system.

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
canDelete()  : bool
Check if $user can delete RolesPermissions
canDownloadTemplate()  : bool
Check if the user can download waiver type templates.
canEdit()  : bool
Check if $user can edit RolesPermissions
canGridData()  : bool
Check if $user can view role
canIndex()  : bool
Check if $user can view role
canToggleActive()  : bool
Check if the user can toggle the active status of a waiver type.
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
_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|null

canDownloadTemplate()

Check if the user can download waiver type templates.

public canDownloadTemplate(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool

Determines authorization for downloading PDF templates associated with waiver types. This allows users to view and print blank waiver forms.

Authorization Logic:

  • Delegates to permission-based policy evaluation
  • Typically allows any authenticated user to download templates
  • Templates are blank forms, not containing sensitive data

Use Case:

  • Gathering stewards download templates for manual collection
  • Kingdom officers review template content
  • Members preview waivers before attending gatherings
  • Templates can be external URLs or uploaded PDFs
Parameters
$user : KmpIdentityInterface

The user attempting to download

$entity : BaseEntity

The waiver type entity

$optionalArgs : mixed

Additional arguments for policy evaluation

Tags
see
BasePolicy::_hasPolicy()

Core permission validation

Return values
bool

True if user can download template, false otherwise

canToggleActive()

Check if the user can toggle the active status of a waiver type.

public canToggleActive(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool

Determines authorization for activating or deactivating waiver types, which affects their availability for gathering configuration.

Authorization Logic:

  • Delegates to permission-based policy evaluation
  • Typically requires Kingdom officer permissions
  • Same requirements as editing a waiver type

Use Case:

  • Kingdom officers can enable/disable waiver types
  • Deactivated types remain in database but are hidden from selection
  • Useful for retiring outdated waiver types without deletion
Parameters
$user : KmpIdentityInterface

The user attempting to toggle status

$entity : BaseEntity

The waiver type entity

$optionalArgs : mixed

Additional arguments for policy evaluation

Tags
see
BasePolicy::_hasPolicy()

Core permission validation

Return values
bool

True if user can toggle active status, false otherwise

_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

_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

        
On this page

Search results