The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Dochazka::REST::Dispatch::ACL - ACL module

VERSION

Version 0.298

DESCRIPTION

This module provides helper code for ACL checks.

EXPORTS

FUNCTIONS

check_acl

Compare priv level of resource ($acl) with the priv level of the employee ($priv). If $priv is at least as high as the $acl, the function returns

    $CELL->status_ok( 'DISPATCH_ACL_CHECK' )

otherwise it returns:

    $CELL->status_not_ok( 'DISPATCH_ACL_CHECK' )

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, undef is returned to signify that the check passed.