Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page was created because of 

Jira Legacy
serverJIRA (openlmis.atlassian.net)
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId448ba138-230b-3f91-a83e-16e7db1deed1
keyOLMIS-1205
 and provide basic information about new rights that should be added into the requisition module.

...

EndpointError codeError message
Initiate

403

Forbidden

You do not have the following permission to perform this action: REQUISITION_CREATE
UpdateYou do not have the following permission to perform this action: REQUISITION_CREATE/REQUISITION_APPROVE/REQUISITION_AUTHORIZE (depends on requisition status)
Submit
You do not have the following permission to perform this action: REQUISITION_CREATE
Approve
You do not have the following permission to perform this action: REQUISITION_APPROVE
AuthorizeYou do not have the following permission to perform this action: REQUISITION_AUTHORIZE
DeleteYou do not have the following permission to perform this action: REQUISITION_DELETE
ViewYou do not have the following permission to perform this action: REQUISITION_VIEW

How to check permission

The most easy way to check if the given user has the given permission is to use /users/{id}/hasRight endpoint. This endpoint returns a small object that contain only one bool property with the result. Also, because we need right ID we should use /rights/search endpoint to retrieve a correct right based on the provided name. In the first approach we could create/extend a service that will use those two endpoints and use it where it is needed (probably in Requisition Controller).

...