App::Dochazka::REST::Dispatch::Shared - Shared dispatch functions
This module provides code that is, or may be, used by more than one resource handler method.
The package variable %f_dispatch is used in fetch_by_eid, fetch_by_nick, and fetch_own.
%f_dispatch
fetch_by_eid
fetch_by_nick
fetch_own
Takes two scalar arguments, "key" and "value" and determines whether or not the database contains an object answering to that description.
This should be used only for resources that require an exact match.
Check request entity for presence of properties
Takes three arguments:
- $d_obj is the App::Dochazka::REST::Dispatch object - $emp is an employee object (blessed hashref) - $over is a hashref with zero or more employee properties and new values
The values from $over replace those in $emp
Called from handlers in App::Dochazka::REST::Dispatch. Takes three arguments:
- $d_obj is the App::Dochazka::REST::Dispatch object - $ignore_me will be undef - $new_emp_props is a hashref with employee properties and their values (guaranteed to contain 'nick')
- $d_obj is the dispatch (App::Dochazka::REST::Dispatch) object - $sched is a schedule object (blessed hashref) - $over is a hashref with zero or more schedule properties and new values
The values from $over replace those in $emp.
$over
$emp
For 'priv' and 'schedule' resources. Given the request context, extract the first component, which will always be either 'priv' or 'schedule'. Based on that, generate the object class, property name, and ID property name for use in the resource handler.
For 'priv/history' and 'schedule/history' resources. Given the request context, extract or generate six values needed by the resource handler.
Shared GET handler for 'priv' and 'schedule' lookups. Takes four arguments:
$d_obj
$t
$pass
$key
$value
ACL check -- 'inactive' and 'active' employees can only operate on their own EID. Returns boolean 1 or 0, where 1 means "ACL check passed".
Apply ACL rules on which fields can be updated. If privlevel is inactive or active, analyze which fields the user wants to update (passerbies will be rejected earlier in Resource.pm, and admins can edit any field)
Returns boolean 1 or 0, where 1 means "ACL check passed".
- $d_obj is the dispatch object - $act is an activity object (blessed hashref) - $over is a hashref with zero or more activity properties and new values
The values from $over replace those in $act
- $d_obj is the dispatch object - $obj is a (priv/schedule) history object (blessed hashref) - $over is a hashref with zero or more history properties and new values
The values from $over replace those in $obj
Takes two arguments: the dispatch object and the properties that are supposed to be an activity object to be inserted.
Shared routine for inserting attendance intervals.
Shared routine for inserting lock intervals.
- $d_obj is the dispatch object - $int is an interval or lock object (blessed hashref) - $over is a hashref with zero or more interval properties and new values
The values from $over replace those in $int
Parses qualifiers string into a hashref. Checks values for sanity; returns a status object.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
To install App::Dochazka::REST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Dochazka::REST
CPAN shell
perl -MCPAN -e shell install App::Dochazka::REST
For more information on module installation, please visit the detailed CPAN module installation guide.