KMP PHP API Reference

GatheringPolicy extends BasePolicy
in package

Gathering Policy

Manages authorization for gathering operations. Authorization is driven by the Roles → Permissions → Policies system, with additional permissions for stewards (event staff marked as stewards).

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
canCalendar()  : bool
Check if user can calendar.
canCancel()  : bool
Check if user can cancel.
canDelete()  : bool
Check if $user can delete RolesPermissions
canEdit()  : bool
Check if user can edit a gathering
canGridData()  : bool
Check if $user can view role
canIndex()  : bool
Check if user can index.
canQuickView()  : bool
Check if user can quick view a gathering
canUncancel()  : bool
Check if user can uncancel.
canView()  : bool
Check if user can view the full gathering details
canViewAttendance()  : bool
Check if user can view attendance information for a gathering
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
_isGatheringSteward()  : bool
Check if user is a steward for the given 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|null

canEdit()

Check if user can edit a gathering

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

Users can edit if they have the standard edit permission OR if they are a steward for the gathering.

Parameters
$user : KmpIdentityInterface

The user

$entity : BaseEntity

The gathering entity

$optionalArgs : mixed

Optional arguments

Return values
bool

canQuickView()

Check if user can quick view a gathering

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

All authenticated users can quick view any gathering. This provides basic gathering information without requiring special permissions.

Parameters
$user : KmpIdentityInterface

The user

$entity : BaseEntity

The gathering entity

$optionalArgs : mixed

Optional arguments

Return values
bool

Always returns true for authenticated users

canView()

Check if user can view the full gathering details

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

Users can view the full gathering details if they have the standard view permission OR if they are a steward for the gathering.

Parameters
$user : KmpIdentityInterface

The user

$entity : BaseEntity

The gathering entity

$optionalArgs : mixed

Optional arguments

Return values
bool

canViewAttendance()

Check if user can view attendance information for a gathering

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

Users with appropriate permissions can view attendance details including total count and list of attendees who have shared with the hosting group. Stewards can also view attendance for gatherings they manage.

Parameters
$user : KmpIdentityInterface

The user.

$entity : BaseEntity

The gathering entity

$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

_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

_isGatheringSteward()

Check if user is a steward for the given gathering

protected _isGatheringSteward(KmpIdentityInterface $user, BaseEntity $entity) : bool

Queries the gathering_staff table to see if the user is assigned as a steward (is_steward = true) for this gathering.

Parameters
$user : KmpIdentityInterface

The user

$entity : BaseEntity

The gathering entity

Return values
bool

True if user is a steward for this gathering


        
On this page

Search results