MemberPolicy
extends BasePolicy
in package
role policy
Table of Contents
Constants
- IMPORT_MEMBER_DATA_PERMISSION : mixed = 'Can Import Member Data'
- KINGDOM_SENESCHAL_OFFICE : mixed = 'Kingdom Seneschal'
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
- canAddNote() : bool
- Check if $user can add note
- canChangePassword() : bool
- Check if $user can change password
- canDelete() : bool
- Check if $user can delete Member
- canEdit() : bool
- Check if $user can edit RolesPermissions
- canEditAdditionalInfo() : bool
- Check if $user can edit additional info
- canGridData() : bool
- Check if $user can view role
- canImportExpirationDates() : bool
- Check if $user can import expiration dates
- canIndex() : bool
- Check if $user can view role
- canPartialEdit() : bool
- Check if $user can partial edit Member
- canProfile() : bool
- Check if $user can view their own profile
- canQueryPii() : bool
- Private-field sorting/filtering requires permission across the entire result set.
- canSendMobileCardEmail() : bool
- Check if $user can send mobile card email
- canSubmitScaMemberInfo() : bool
- Check if user can submit sca member info.
- canVerifyMembership() : bool
- Check if $user can verify membership
- canVerifyQueue() : bool
- Check if $user can verify queue
- canView() : bool
- Check if $user can view Member
- canViewAdditionalInformation() : bool
- Check if $user can view additional information for a Member
- canViewCard() : bool
- Check if $user can view card
- canViewCardJson() : bool
- Check if $user can view card json
- canViewPii() : bool
- Check if $user can view PII for a Member
- canViewPrivateNotes() : bool
- Check if $user can view hidden
- scopeIndex() : mixed
- Apply scope for index action.
- scopeViewPii() : mixed
- Restrict private-field searches to records whose private fields the actor may read.
- _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.
- isCurrentKingdomSeneschal() : bool
- Confirm the narrow import grant belongs to the current Kingdom Seneschal.
Constants
IMPORT_MEMBER_DATA_PERMISSION
private
mixed
IMPORT_MEMBER_DATA_PERMISSION
= 'Can Import Member Data'
KINGDOM_SENESCHAL_OFFICE
private
mixed
KINGDOM_SENESCHAL_OFFICE
= 'Kingdom Seneschal'
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|nullcanAdd()
Check if $user can add RolesPermissions
public
canAdd(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity|Table
- $optionalArgs : mixed
Return values
boolcanAddNote()
Check if $user can add note
public
canAddNote(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanChangePassword()
Check if $user can change password
public
canChangePassword(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanDelete()
Check if $user can delete Member
public
canDelete(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanEdit()
Check if $user can edit RolesPermissions
public
canEdit(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanEditAdditionalInfo()
Check if $user can edit additional info
public
canEditAdditionalInfo(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanGridData()
Check if $user can view role
public
canGridData(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanImportExpirationDates()
Check if $user can import expiration dates
public
canImportExpirationDates(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanIndex()
Check if $user can view role
public
canIndex(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanPartialEdit()
Check if $user can partial edit Member
public
canPartialEdit(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanProfile()
Check if $user can view their own profile
public
canProfile(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity|Table
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanQueryPii()
Private-field sorting/filtering requires permission across the entire result set.
public
canQueryPii(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
- $entity : BaseEntity|Table
- $optionalArgs : mixed
Return values
boolcanSendMobileCardEmail()
Check if $user can send mobile card email
public
canSendMobileCardEmail(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanSubmitScaMemberInfo()
Check if user can submit sca member info.
public
canSubmitScaMemberInfo(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
- $entity : BaseEntity
- $optionalArgs : mixed
Return values
boolcanVerifyMembership()
Check if $user can verify membership
public
canVerifyMembership(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanVerifyQueue()
Check if $user can verify queue
public
canVerifyQueue(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanView()
Check if $user can view Member
public
canView(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanViewAdditionalInformation()
Check if $user can view additional information for a Member
public
canViewAdditionalInformation(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity|Table
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanViewCard()
Check if $user can view card
public
canViewCard(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanViewCardJson()
Check if $user can view card json
public
canViewCardJson(KmpIdentityInterface $user, BaseEntity $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanViewPii()
Check if $user can view PII for a Member
public
canViewPii(KmpIdentityInterface $user, BaseEntity|Table $entity, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity|Table
- $optionalArgs : mixed
-
Optional arguments
Return values
boolcanViewPrivateNotes()
Check if $user can view hidden
public
canViewPrivateNotes(KmpIdentityInterface $user, BaseEntity $entity) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
- $entity : BaseEntity
Return values
boolscopeIndex()
Apply scope for index action.
public
scopeIndex(KmpIdentityInterface $user, mixed $query) : mixed
Parameters
- $user : KmpIdentityInterface
- $query : mixed
scopeViewPii()
Restrict private-field searches to records whose private fields the actor may read.
public
scopeViewPii(KmpIdentityInterface $user, mixed $query) : mixed
Parameters
- $user : KmpIdentityInterface
- $query : mixed
_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_getPermissions()
Check if $user can view hidden
protected
_getPermissions(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
Return values
bool_getPolicies()
Check if $user can view hidden
protected
_getPolicies(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
Return values
bool_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_isSuperUser()
Check if $user is a super user
protected
_isSuperUser(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user.
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
boolisCurrentKingdomSeneschal()
Confirm the narrow import grant belongs to the current Kingdom Seneschal.
private
isCurrentKingdomSeneschal(KmpIdentityInterface $user) : bool
Parameters
- $user : KmpIdentityInterface
-
The user being authorized.