NAME
App::Dochazka::REST::Dispatch::ACL - ACL module
VERSION
Version 0.400
DESCRIPTION
This module provides helper code for ACL checks.
EXPORTS
PACKAGE VARIABLES
The 'check_acl' routine uses a hash to look up which privlevels satisfy a given ACL profile.
FUNCTIONS
check_acl
Compare ACL profile of a resource, $profile
, with the privlevel of the current employee, $privlevel
. If the former is at least as high as the latter, the function returns true, otherwise false.
check_acl_context
Check ACL and compare with eid in request body. This routine is designed for resources that have an ACL profile of 'active'. If the request body contains an 'eid' property, it is checked against the current user's EID. If they are different and the current user's priv is 'active', DOCHAZKA_FORBIDDEN_403 is returned; otherwise, an OK status is returned to signify that the check passed.
If the request body does not contain an 'eid' property, it is added.
acl_check_iid_lid
When a user attempts to access an interval by IID, or a lock by LID, this is an additional ACL check to make sure non-admin users cannot access intervals and locks belonging to other users.