ServicePrincipalPolicy
extends BasePolicy
in package
ServicePrincipal Entity Policy
Manages access control for service principal entities. Only super users can manage service principals.
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 a service principal.
- canDelete() : bool
- Check if user can delete a service principal.
- canEdit() : bool
- Check if user can edit a service principal.
- canGridData() : bool
- Check if $user can view role
- canIndex() : bool
- Check if $user can view role
- canManageRoles() : bool
- Check if user can manage roles.
- canManageTokens() : bool
- Check if user can manage tokens.
- canRegenerateCredentials() : bool
- Check if user can regenerate credentials.
- canView() : bool
- Check if user can view a service principal.
- 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
- _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|nullcanAdd()
Check if user can add a service principal.
public
canAdd(KmpIdentityInterface $user, ServicePrincipal $servicePrincipal, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $servicePrincipal : ServicePrincipal
-
The entity
- $optionalArgs : mixed
Return values
boolcanDelete()
Check if user can delete a service principal.
public
canDelete(KmpIdentityInterface $user, ServicePrincipal $servicePrincipal, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $servicePrincipal : ServicePrincipal
-
The entity
- $optionalArgs : mixed
Return values
boolcanEdit()
Check if user can edit a service principal.
public
canEdit(KmpIdentityInterface $user, ServicePrincipal $servicePrincipal, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $servicePrincipal : ServicePrincipal
-
The entity
- $optionalArgs : mixed
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
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
boolcanManageRoles()
Check if user can manage roles.
public
canManageRoles(KmpIdentityInterface $user, ServicePrincipal $servicePrincipal) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $servicePrincipal : ServicePrincipal
-
The entity
Return values
boolcanManageTokens()
Check if user can manage tokens.
public
canManageTokens(KmpIdentityInterface $user, ServicePrincipal $servicePrincipal) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $servicePrincipal : ServicePrincipal
-
The entity
Return values
boolcanRegenerateCredentials()
Check if user can regenerate credentials.
public
canRegenerateCredentials(KmpIdentityInterface $user, ServicePrincipal $servicePrincipal) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $servicePrincipal : ServicePrincipal
-
The entity
Return values
boolcanView()
Check if user can view a service principal.
public
canView(KmpIdentityInterface $user, ServicePrincipal $servicePrincipal, mixed ...$optionalArgs) : bool
Parameters
- $user : KmpIdentityInterface
-
The user
- $servicePrincipal : ServicePrincipal
-
The entity
- $optionalArgs : mixed
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
_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_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.