ACLService
class ACLService
Collection of functions for managing User's ACLs.
Methods
Returns an array containing access control list information. When the $acl instance variable is empty an empty array is returned.
Ensures that we are always dealing with an array of ACLs
Add ACL to user's acl field as an element of an array.
Deletes ACL if allowed.
Manages the adding and removing of ACLs.
Removes ACL from user's acl field array.
Sets ACL at registration. If users table is empty the default value is Admin. Otherwise, we set the value to "".
Updates user's acl field
Returns array of unused ACLs.
Returns array of used ACLs.
Details
at line 22
static array
aclsForUser(Users $user)
Returns an array containing access control list information. When the $acl instance variable is empty an empty array is returned.
at line 33
static array
aclToArray(mixed $acls)
Ensures that we are always dealing with an array of ACLs
at line 48
static bool
addAcl(int $user_id, string $acl)
Add ACL to user's acl field as an element of an array.
at line 67
static void
checkACL(ACL $acl)
Checks if ACL is found and sets flash message if not the case. Also, checks if it is assigned to a user and sets flash message.
at line 85
static bool
deleteIfAllowed(int $id)
Deletes ACL if allowed.
at line 109
static void
manageAcls(array $acls, Users $user, array $newAcls, array $userAcls)
Manages the adding and removing of ACLs.
at line 127
static bool
removeAcl(int $user_id, string $acl)
Removes ACL from user's acl field array.
at line 147
static string
setAclAtRegistration()
Sets ACL at registration. If users table is empty the default value is Admin. Otherwise, we set the value to "".
at line 180
static void
updateUserACLs(Users $user, array $userAcls, array $acls, array|null $postAcls = null)
Updates user's acl field
at line 191
static array
unUsedACLs()
Returns array of unused ACLs.
at line 207
static array
usedACLs()
Returns array of used ACLs.