AclService
in package
ACL Service - Replaces QubitAcl (362 uses)
Table of Contents
Constants
- DENY = \AtomExtensions\Constants\AclConstants::DENY
- GRANT = \AtomExtensions\Constants\AclConstants::GRANT
- INHERIT = \AtomExtensions\Constants\AclConstants::INHERIT
Properties
- $ACTIONS : array<string|int, mixed>
Methods
- addFilterDraftsCriteria() : mixed
- Filter a Laravel Query Builder query to only return published records OR records the current user can view as drafts.
- check() : bool
- forwardToLoginAction() : void
- forwardToSecureAction() : void
- forwardUnauthorized() : mixed
- getRepositoryAccess() : array<string|int, mixed>
- getUser() : object|null
- getUserGroups() : array<string|int, mixed>
- hasGroup() : bool
- isAdministrator() : bool
- isContributor() : bool
- isEditor() : bool
- isTranslator() : bool
- setUser() : void
Constants
DENY
public
mixed
DENY
= \AtomExtensions\Constants\AclConstants::DENY
GRANT
public
mixed
GRANT
= \AtomExtensions\Constants\AclConstants::GRANT
INHERIT
public
mixed
INHERIT
= \AtomExtensions\Constants\AclConstants::INHERIT
Properties
$ACTIONS
public
static array<string|int, mixed>
$ACTIONS
= ['read' => 'Read', 'create' => 'Create', 'update' => 'Update', 'delete' => 'Delete', 'translate' => 'Translate', 'publish' => 'Publish', 'viewDraft' => 'View Draft', 'readMaster' => 'Read Master', 'readReference' => 'Read Reference', 'readThumbnail' => 'Read Thumbnail', 'createTerm' => 'Create Term', 'list' => 'List']
Methods
addFilterDraftsCriteria()
Filter a Laravel Query Builder query to only return published records OR records the current user can view as drafts.
public
static addFilterDraftsCriteria(mixed $query) : mixed
Status type_id 158 = publicationStatusId Status status_id 160 = PUBLICATION_STATUS_PUBLISHED_ID
Parameters
- $query : mixed
-
Laravel Query Builder instance or Propel Criteria
check()
public
static check(object|null $resource, mixed $action[, object|null $user = null ]) : bool
Parameters
- $resource : object|null
- $action : mixed
- $user : object|null = null
Return values
boolforwardToLoginAction()
public
static forwardToLoginAction() : void
forwardToSecureAction()
public
static forwardToSecureAction() : void
forwardUnauthorized()
public
static forwardUnauthorized([bool $return = false ]) : mixed
Parameters
- $return : bool = false
getRepositoryAccess()
public
static getRepositoryAccess(string $action) : array<string|int, mixed>
Parameters
- $action : string
Return values
array<string|int, mixed>getUser()
public
static getUser() : object|null
Return values
object|nullgetUserGroups()
public
static getUserGroups(int|null $userId) : array<string|int, mixed>
Parameters
- $userId : int|null
Return values
array<string|int, mixed>hasGroup()
public
static hasGroup(int $groupId[, object|null $user = null ]) : bool
Parameters
- $groupId : int
- $user : object|null = null
Return values
boolisAdministrator()
public
static isAdministrator([object|null $user = null ]) : bool
Parameters
- $user : object|null = null
Return values
boolisContributor()
public
static isContributor([object|null $user = null ]) : bool
Parameters
- $user : object|null = null
Return values
boolisEditor()
public
static isEditor([object|null $user = null ]) : bool
Parameters
- $user : object|null = null
Return values
boolisTranslator()
public
static isTranslator([object|null $user = null ]) : bool
Parameters
- $user : object|null = null
Return values
boolsetUser()
public
static setUser(object|null $user) : void
Parameters
- $user : object|null