NAME

App::Dochazka::REST::Dispatch::Shared - Shared dispatch functions

DESCRIPTION

This module provides code that is, or may be, used by more than one resource handler method.

EXPORTS

PACKAGE VARIABLES

The package variable %f_dispatch is used in fetch_by_eid, fetch_by_nick, and fetch_own.

FUNCTIONS

shared_first_pass_lookup

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.

shared_entity_check

Check request entity for presence of properties

shared_get_employee_pass1

shared_get_employee

shared_update_employee

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

shared_insert_employee

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')

shared_update_schedule

Takes three arguments:

- $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.

shared_get_class_prop_id

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.

shared_history_init

For 'priv/history' and 'schedule/history' resources. Given the request context, extract or generate values needed by the resource handler.

shared_get_privsched

Shared GET handler for 'priv' and 'schedule' lookups. Takes four arguments:

$d_obj - dispatch object
$t - either 'priv' or 'schedule'
$pass - either 1 or 2
$key - either 'EID' or 'nick'
$value - EID or nick value to lookup

shared_employee_acl_part1

ACL check -- 'inactive' and 'active' employees can only operate on their own EID. Returns boolean 1 or 0, where 1 means "ACL check passed".

shared_employee_acl_part2

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".

shared_update_activity

Takes three arguments:

- $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

shared_update_component

Takes three arguments:

- $d_obj is the dispatch object
- $comp is a component object (blessed hashref)
- $over is a hashref with zero or more component properties and new values

The values from $over replace those in $comp

shared_update_history

Takes three arguments:

- $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

shared_insert_activity

Takes two arguments: the dispatch object and the properties that are supposed to be an activity object to be inserted.

shared_insert_component

Takes two arguments: the dispatch object and the properties that are supposed to be a component object to be inserted.

shared_insert_interval

Shared routine for inserting attendance intervals.

shared_insert_lock

Shared routine for inserting lock intervals.

shared_insert_intlock

shared_update_intlock

Takes three arguments:

- $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

shared_process_quals

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:

Around line 586:

You forgot a '=back' before '=head2'

You forgot a '=back' before '=head2'