KMP PHP API Reference

GatheringAttendancePolicy extends BasePolicy
in package

GatheringAttendance policy

Extends BasePolicy to leverage the standard RBAC permission system while also allowing members to manage their own gathering attendance records.

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 gathering attendance
canDelete()  : bool
Check if user can delete gathering attendance
canEdit()  : bool
Check if user can edit gathering attendance
canGridData()  : bool
Check if $user can view role
canIndex()  : bool
Check if $user can view role
canView()  : bool
Check if user can view gathering attendance
canViewCrown()  : bool
Explicit crown-recipient grant, populated by the Awards permission migration.
canViewPrivateNotes()  : bool
Check if $user can view hidden
canViewShared()  : bool
Consent and recipient scope for attendance enrichment outside the owner's page.
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.
canManageMemberAttendance()  : bool
Determine whether the user can manage attendance for a member.

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

canAdd()

Check if user can add gathering attendance

public canAdd(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool

Users can register their own attendance or users with appropriate permissions can register attendance for others.

Parameters
$user : KmpIdentityInterface

The user.

$entity : BaseEntity|Table

The entity or table

$optionalArgs : mixed

Optional arguments

Return values
bool

canView()

Check if user can view gathering attendance

public canView(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool

Users can view their own attendance or users with appropriate permissions can view others' attendance.

Parameters
$user : KmpIdentityInterface

The user.

$entity : BaseEntity|Table

The entity or table

$optionalArgs : mixed

Optional arguments

Return values
bool

_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

_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

_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
bool
On this page

Search results