NAME
Kernel::WebApp::Controller::API::Role::RequiresAgentChatPermission – Require permission for the current chat(s).
PUBLIC INTERFACE
Just consume this role to make sure that your endpoint can only be used by agents with permission for the current chat(s) (see further below for which permission and which chat):
with qw(
Kernel::WebApp::Controller::API::Role::RequiresAgentChatPermission
)
It works by wrapping a default implementation around Kernel::WebApp::Controller::API::Base::Authorize(), which requires chat permission or otherwise sends a 403 Forbidden
response.
You can still provide your own Authorize()
method to perform additional checks in the endpoint.