Adjust right checks for multiple suppliers

Description

As part of OLMIS‌-5142, we introduced the requisition split feature into the requisition service. As part of this ticket, we would like to adjust right checks in the service so users would see correct requisitions. Currently, after the split both original and partner users can see all requisitions because we only check if facility and program are correct.

Acceptance criteria

  • Adjust check for endpoints that change a requisition status (like /submit, /authorize, etc)

    • for requisitions before approve status we would simply check if a user has a correct right for the given facility and program

    • for requisitions after or during approval we would simply check if a user has a role assignment for the given program and supervisory node

    • we would need to update permission check for update endpoint as well

  • Modified the way how the requisition search endpoint works

    • the endpoint should retrieve requisitions based on permission strings and requisitions based on user’s role assignments

    • the result list should not contain duplication

  • Regulate UI if neededOLMIS‌-5976

  • Adapt demo data

    • remove requisition groups from partner supervisory nodes

    • chaz user should be able to approve partner requisition

Checklists

Activity

Show:

Joanna Szymańska 
February 13, 2019 at 1:34 PM

I checked this ticket and everything works according to the acceptance criteria.

Sam Im 
January 15, 2019 at 9:22 PM
(edited)

Background to this issue: when implemented in eLMIS, the workaround to this permissions issue was to create a new Program for the supply partner (screenshot located in the requirements page listed as Source Program and Destination Program - https://openlmis.atlassian.net/wiki/spaces/OP/pages/114915083/Configuring+of+products+list+for+supply+Partners)

Chongsun Ahn 
January 14, 2019 at 11:03 PM

I think since this is an important design topic that will affect a good portion of the system, we should post this on the Dev forum to discuss. Can you do that? In that post, lay out:

  • The problem we are trying to solve (people seeing requisitions they should not be able to see)

  • Your proposal on how we can address this problem and things that will be affected

Then the tech community can see this change in design and we can discuss. I can respond to your post about my concerns and if there are alternative approaches we can explore. We can try to come to a decision about the best way forward either through the forum, or if we need to resolve faster, we can schedule a call.

Chongsun Ahn 
January 14, 2019 at 9:54 PM

Thanks Łukasz for creating this ticket. It's good that you have encountered this issue, thought about it, and came up with a design proposal.

There is a statement in the description of the ticket that is inaccurate; supervision rights are not exactly by facility and program, but by either program, or program and supervisory node. You can extrapolate that to permissions by facility and program.

So I have some concerns about this approach. The role-based access control (RBAC) in the system is already complex and we should not be quick to add a new dimension to it. Since RBAC is already defined by supervisory node (see comment above), we wouldn't necessarily have to add it there; but this ticket is proposing adding it to the permission strings design. This would increase complexity by:

  • Adding a new dimension to permission strings - it becomes less clear what a permission string means

  • Requiring all requisitions have a supervisory node - this changes what supervisory node id in a requisition means. Before it meant that it is now in the supervisory chain and the node currently assigned is where it is in the chain. Once a node is assigned when created, we can't assume that anymore.

The criteria we are trying to satisfy is to only show the appropriate requisitions to the user. Is it possible to modify the approach of how we search/view requisitions to filter by supervisory node id?

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

1w 5h 30m logged

Components

Sprint

Fix versions

Priority

Time Assistant

Created January 14, 2019 at 2:56 PM
Updated March 6, 2019 at 3:11 PM
Resolved February 13, 2019 at 1:35 PM