Update Manage PODs screen to respect user rights

Description

As a Spock or Phil I should be able to search for PoD. The PoDs that I have access to should include the ones that I have PoD supervision rights for (view & edit) and the PoDs for facilities that my facility ships to (view only).

There should be two facility dropdowns (requesting and supplying) and a program dropdown on the search screen. They should only display relevant information - the facilities and programs that I have rights for. Only one of the requesting/supplying facilities dropdown is required (any of those two) Use the:

/users/{userId}/fulfillmentFacilities /users/{userId}/facilities /users/{userId}/supportedPrograms

or permission strings endpoints as necessary to obtain those.

All users that can see the PoDs on the search PoD screen can also access it to see more details. If I only have POD_VIEW right or shipment rights, the details screen is not editable. The details screen is editable only if both:
a) I have POD_MANAGE right for the requesting facility PoD belongs to
b) The PoD is not confirmed yet.

Acceptance criteria

  • On the Manage Proofs of Delivery screen there's a dropdown to select requesting facility, supplying facility and a program

    • those filter option should be visible in the result table as columns

  • Users can navigate to the details view for any PoD

  • Details view is not editable if the PoD is confirmed

  • Details view is not editable if user does not have POD_MANAGE supervision right

  • /orders endpoint is updated - details in https://openlmis.atlassian.net/browse/OLMIS-4240#icft=OLMIS-4240

Attachments

1
  • 14 Mar 2018, 12:22 PM
100% Done
Loading...

QAlity Plus - Test Management

Checklists

Activity

Show:

Klaudia PałkowskaMarch 16, 2018 at 2:05 PM

I re-tested the ticket, and everything works properly.

Mateusz KwiatkowskiMarch 14, 2018 at 2:17 PM

I've changed endpoint to one suggested by you, it is also cached resource on the UI so it should improve performance.

Sebastian BrudzińskiMarch 14, 2018 at 1:31 PM
Edited

I created a new user and assigned him a single right - edit shipments. I think using

/user/{userId}/programs

may fix this. If not, we may need to extract programs from permission strings.

Mateusz KwiatkowskiMarch 14, 2018 at 1:17 PM
Edited

I've used /api/users/id/supportedPrograms endpoint for populating program list as suggested in ticket description. What I'm supposed to do in this situation? Should I parse all permission strings on the UI and get List of programs that are assigned for POD/Shipment rights? Probably empty list is caused by lack of home facility, if I remember correctly this endpoint takes all supported programs from home facility. Which user you used for testing?

Sebastian BrudzińskiMarch 14, 2018 at 12:22 PM

Still problems with accessing this view by shipper. If I only have shipment rights assigned, I cannot see any program in the filter dropdown and therefore cannot search anything on this screen:

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

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

1w 2h 30m logged3d 1h 30m remaining

Components

Sprint

Fix versions

Priority

Time Assistant

Created February 14, 2018 at 1:51 PM
Updated November 29, 2020 at 10:57 AM
Resolved March 16, 2018 at 2:05 PM