KMP PHP API Reference

RecommendationsTablePolicy extends BasePolicy
in package

Table-level authorization policy for Recommendations in the Awards plugin.

Implements query scoping based on user approval authority and organizational scope. Supports open recommendation submission and export authorization.

Tags
see
BasePolicy

Base table authorization functionality

see
RecommendationsTable

Recommendation data management

see

/docs/5.2.16-awards-recommendations-table-policy.md Full documentation

Table of Contents

Methods

before()  : bool|null
Check if $user is a super user and can skip auth with an auto True
canAdd()  : bool
Authorize recommendation creation (open access).
canDelete()  : bool
Check if $user can delete RolesPermissions
canEdit()  : bool
Check if $user can edit RolesPermissions
canExport()  : bool
Authorize recommendation export to CSV.
canGridData()  : bool
Check if $user can view role
canIndex()  : bool
Check if $user can view role
canView()  : bool
Check if $user can view RolesPermissions
canViewPrivateNotes()  : bool
Check if $user can view hidden
scopeIndex()  : Query
Apply authorization scoping to recommendation queries.
_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

canAdd()

Authorize recommendation creation (open access).

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

The user requesting creation access

$entity : BaseEntity|Table

The target entity or table

$optionalArgs : mixed

Additional authorization arguments

Return values
bool

Always true for open recommendation submission

canExport()

Authorize recommendation export to CSV.

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

Delegates to canIndex - users who can list can export.

Parameters
$user : KmpIdentityInterface

The user requesting export access

$entity : BaseEntity|Table

The target entity or table

$optionalArgs : mixed

Additional authorization arguments

Return values
bool

True if user has index permission

scopeIndex()

Apply authorization scoping to recommendation queries.

public scopeIndex(KmpIdentityInterface $user, Query $query) : Query

Filters recommendations by branch access and approval authority levels. Discovers approval levels from canApproveLevel* permission methods.

Parameters
$user : KmpIdentityInterface

The user requesting data access

$query : Query

The base query to scope

Return values
Query

The scoped query with authorization filtering

_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