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

This resource retrieves the privlevel of an arbitrary employee specified by EID.

If no timestamp is given, the present privlevel is retrieved. If a timestamp is present, the privlevel as of that timestamp is retrieved. EOH }, 'priv/help' => { target => { GET => '_get_default', # _get_default is the name of a subroutine in # the module pointed to by the 'target_module' # property, below POST => '_post_default', PUT => '_put_default', DELETE => '_delete_default', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'passerby', cli => 'priv help', description => 'Display priv resources', documentation => <<'EOH', =pod

This resource retrieves a listing of all resources available to the caller (currently logged-in employee). EOH }, 'priv/history/eid/:eid' => { target => { GET => '_history_eid', POST => '_history_eid', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'admin', cli => 'priv history eid $EID [$JSON]', description => 'Retrieves entire history of privilege level changes for employee with the given EID (GET); or, with an appropriate content body, adds (POST) a record to employee\'s privhistory', documentation => <<'EOH', =pod

  • GET

    Retrieves the "privhistory", or history of changes in privilege level, of the employee with the given EID.

  • POST

    Adds a record to the privhistory of the given employee. The content body should contain two properties: "timestamp" and "privlevel".

    N.B. It is assumed that privhistories will be built up record-by-record, but this dispatch target could conceivably support insertion of multiple privhistory records.

Update note: histories can be updated by adding new records and deleting old ones. Existing history records cannot be changed. Adds/deletes should be performed with due care - especially with regard to existing employee attendance data (if any). EOH }, 'priv/history/eid/:eid/:tsrange' => { target => { GET => '_history_eid', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'admin', cli => 'priv history eid $EID $TSRANGE', description => 'Get a slice of history of privilege level changes for employee with the given EID', documentation => <<'EOH', =pod

Retrieves a slice (given by the tsrange argument) of the employee's "privhistory" (history of changes in privilege level). EOH }, 'priv/history/nick/:nick' => { target => { GET => '_history_nick', POST => '_history_nick', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'admin', cli => 'priv history nick $NICK [$JSON]', description => 'Retrieves entire history of privilege level changes for employee with the given nick (GET); or, with an appropriate content body, adds (PUT) a record to employee\'s privhistory', documentation => <<'EOH', =pod

  • GET

    Retrieves the "privhistory", or history of changes in privilege level, of the employee with the given nick.

  • POST

    Adds a record to the privhistory of the given employee. The content body should contain two properties: "timestamp" and "privlevel".

    It is assumed that privhistories will be built up record-by-record, but this dispatch target could conceivably support insertion of multiple privhistory records.

Update note: histories can be updated by adding new records and deleting old ones. Existing history records cannot be changed. Adds/deletes should be performed with due care - especially with regard to existing employee attendance data (if any). EOH }, 'priv/history/nick/:nick/:tsrange' => { target => { GET => '_history_nick', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'admin', cli => 'priv history nick $NICK $TSRANGE', description => 'Get partial history of privilege level changes for employee with the given nick ' . '(i.e, limit to given tsrange)', documentation => <<'EOH', =pod

Retrieves a slice (given by the tsrange argument) of the employee's "privhistory" (history of changes in privilege level). EOH }, 'priv/history/phid/:phid' => { target => { GET => '_priv_by_phid', DELETE => '_priv_by_phid', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'admin', cli => 'priv history phid $PHID', description => 'Retrieves (GET) or deletes (DELETE) a single privilege history record by its PHID', documentation => <<'EOH', =pod

  • GET

    Retrieves a privhistory record by its PHID.

  • DELETE

    Deletes a privhistory record by its PHID.

(N.B.: history records can be added using POST requests on "priv/history/eid/:eid" or "priv/history/nick/:nick") EOH }, 'priv/history/self/?:tsrange' => { target => { GET => '_history_self', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'inactive', cli => 'priv history self [$TSRANGE]', description => 'Retrieves privhistory of present employee, with option to limit to :tsrange', documentation => <<'EOH', =pod

This resource retrieves the "privhistory", or history of changes in privilege level, of the present employee. Optionally, the listing can be limited to a specific tsrange such as "[2014-01-01, 2014-12-31)". EOH }, 'priv/nick/:nick/?:ts' => { target => { GET => '_current_priv', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'admin', cli => 'priv nick $NICK [$TIMESTAMP]', description => 'Get the present privlevel of arbitrary employee, or with optional timestamp, that employee\'s privlevel as of that timestamp', documentation => <<'EOH', =pod

This resource retrieves the privlevel of an arbitrary employee specified by nick.

If no timestamp is given, the present privlevel is retrieved. If a timestamp is present, the privlevel as of that timestamp is retrieved. EOH }, 'priv/self/?:ts' => { target => { GET => '_current_priv', }, target_module => 'App::Dochazka::REST::Dispatch::Priv', acl_profile => 'passerby', cli => 'priv self [$TIMESTAMP]', description => 'Get the present privlevel of the currently logged-in employee, or with optional timestamp, that employee\'s privlevel as of that timestamp', documentation => <<'EOH', =pod

This resource retrieves the privlevel of the caller (currently logged-in employee).

If no timestamp is given, the present privlevel is retrieved. If a timestamp is present, the privlevel as of that timestamp is retrieved. EOH },

});