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
canAddCourtActivity()  : bool
Check if user can attach a court-capable activity to a gathering.
canCalendar()  : bool
Check if user can calendar.
canCancel()  : bool
Check if user can cancel.
canCreateScheduledActivity()  : bool
Check if user can create scheduled activities for a gathering.
canDelete()  : bool
Check if $user can delete RolesPermissions
canEdit()  : bool
Check if user can edit a gathering
canEditActivityDescription()  : bool
Check if user can edit an activity description on a gathering.
canEditScheduledActivity()  : bool
Check if user can edit a scheduled activity on a gathering.
canGridData()  : bool
Check if $user can view role
canIndex()  : bool
Check if user can index.
canPublish()  : bool
Check if user can publish the gathering
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
_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
_isGatheringSteward()  : bool
Check if user is a steward for the given gathering
_isSuperUser()  : bool
Check if $user is a super user
_matchesGrantSource()  : bool
Check whether a policy method was granted by a compatible source entity.

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

canAddCourtActivity()

Check if user can attach a court-capable activity to a gathering.

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

Full gathering editors retain the general activity-management flow. Court planners receive this narrower policy through their scoped Awards permission; the controller additionally verifies that the selected activity can present awards.

Parameters
$user : KmpIdentityInterface

The user

$entity : BaseEntity

The gathering entity

$optionalArgs : mixed

Optional arguments

Return values
bool

canCreateScheduledActivity()

Check if user can create scheduled activities for a gathering.

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

Users can create scheduled activities if they can edit the gathering, are a steward for the gathering, or have the dedicated schedule creation policy.

Parameters
$user : KmpIdentityInterface

The user

$entity : BaseEntity

The gathering entity

$optionalArgs : mixed

Optional arguments

Return values
bool

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

canEditScheduledActivity()

Check if user can edit a scheduled activity on a gathering.

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

Full gathering editors and stewards can edit any schedule row. Dedicated court schedule managers can edit only rows they created.

Parameters
$user : KmpIdentityInterface

The user

$entity : BaseEntity

The gathering entity

$optionalArgs : mixed

First argument should be a scheduled activity

Return values
bool

canPublish()

Check if user can publish the gathering

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

Users can publish the gathering if they have the standard publish permission

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

_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

_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

_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