Koha::Module::Policy::Checkin - Policy contract for the checkin module
my $policy = Koha::Module::Policy::Checkin->new(
{
user => $patron,
library => $branchcode,
}
);
# As hashref, serialized as JSON for the page and the policy
# attribute of API errors. Module keys are under the 'checkin' key.
my $caps = $policy->to_hashref;
Defines what the checkin module UI should offer to the current user at the current library. This is the intersection of system preferences, user permissions, and library context.
The client reads the policy and uses it to show/hide controls. The server still enforces every action - this is informational, not an authorization token.
The keys listed below are returned under the checkin key of the policy envelope, next to the global namespace inherited from Koha::Module::Policy (e.g., audio_alerts, catalog_concerns). See the base class documentation for the full list of global keys. The API contract is described by the checkin_policy definition.
Flags are JSON booleans.
my $module = $policy->module; # 'checkin'
Returns the module name.
Builds the policy hashref for the checkin module.
The policy is delivered to the client in two ways:
exempt_fine sent but permission revoked), the error object carries the updated policy in its policy attribute (see Koha::REST::Plugin::Policy). The client updates its state reactively.The .tt shell injects CAN_user_* flags for page chrome (header, sidebar navigation). This is separate from the module policy which governs the module's functional capabilities.
Koha Development Team <https://koha-community.org/>