[FE] No permission after creating requisitionless order

Description

After creating requisitionless order via “Requisitions → Create Orders”, user is automatically moved to “Orders → Fulfill Orders” page.

If a user does not have the rights to fulfill the order, he will receive an error, and stay on the current page.

Test data

How to reproduce?

  • Log in as the requesting_user1

  • Go to Requisitions → Create Orders

  • Create the order for:

    • Program: ARV

    • Requesting facility: Lilongwe Health Center

    • Supplying facility: Lilongwe District Warehouse

  • You will be moved to the other screen, select and add any product and insert a positive quantity

  • Press create “Create order” and confirm the order in modal panel

Expected result

Order is created and the user is moved to the other page

Actual result

Order is created, but user receives and error, and stays on the current page

Solution

Check for the user rights after submitting the order

  • If the user has rights for fulfillment: Move him to Orders → Fulfill Orders

  • If not: Move him either to home page or Requisitions → Create Orders (IMO better option)

    order-create-error.mkv

Environment

None

Attachments

5
  • 21 Feb 2025, 11:05 AM
  • 21 Feb 2025, 10:54 AM
  • 21 Feb 2025, 10:54 AM
  • 21 Feb 2025, 10:54 AM
  • 28 Jan 2025, 06:57 AM

Checklists

Activity

Show:

Dominik NogaFebruary 25, 2025 at 11:15 AM

i think we can create such a ticket. But this one can be already closed i think? I think i can move it from QA to ‘to be released’, because there is nothing to test here and the bug was fixed.

Maciej GrochalskiFebruary 25, 2025 at 10:52 AM

The error mentioned in the scope of this ticket is indeed not appearing so it is okay .

 

However I would create a ticket to investigate the whole Requisition-less ordering process. There are more errors, which are unclear that come as I mentioned in the comments before.

To access the functionality we need CREATE_ORDERS, then after we choose program/facility parameters we need one of: ORDERS_VIEW, ORDERS_EDIT, SHIPMENTS_EDIT, SHIPMENTS_VIEW, PODS_VIEW, PODS_MANAGE, then at the end to add products we need STOCK_CARDS_VIEW.

So the rights needed could be investigated, and possibly improve errors that come from the BE (“You are not authorized to perform this action” is very unclear, in general what is needed is “VIEW_STOCKS_CARD” right, which can be added by admin user, the system could display it instead).

 

It would be good to take a look at this and have it well documented, maybe in core 3.20, what do you think?

Dominik NogaFebruary 24, 2025 at 8:24 AM
Edited

I should have mentioned that, but i have decided to always move the user to the create order page, instead of the fulfillment page. Because i think it is less confusing, when you are always moved to the same place. What do you think about this?

Maciej GrochalskiFebruary 21, 2025 at 2:24 PM

The issue reported in the ticket is no longer present, however I see in the

Solutions:

 

  • If the user has rights for fulfillment: Move him to Orders → Fulfill Orders

  • If not: Move him either to home page or Requisitions → Create Orders (IMO better option)

could you specify which exactly permission is being checked? I seem to have fulfillment rights for supplying facility and I’m still being redirected to create order page.

Maciej GrochalskiFebruary 21, 2025 at 10:54 AM
Edited

In that case there is still an issue. unfortunately I haven’t found documentation on the confluence - what exact rights are needed and how the flow should look like.

Please take a look:

image-20250221-105108.png
image-20250221-105235.png
image-20250221-105254.png

it seems like one of: ORDERS_VIEW, ORDERS_EDIT, SHIPMENTS_EDIT, SHIPMENTS_VIEW, PODS_VIEW, PODS_MANAGE is also needed.

 

I added PODS_MANAGE and it seems for a next step I need also STOCK_CARDS_VIEW right:

image-20250221-105827.png

 

So summarizing:

To access the functionality we need Create orders,

then after we choose program/facility parameters we need one of: ORDERS_VIEW, ORDERS_EDIT, SHIPMENTS_EDIT, SHIPMENTS_VIEW, PODS_VIEW, PODS_MANAGE,

then at the end to add products we need STOCK_CARDS_VIEW.

 

All rights were added to home facility to make it work.

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

Details

Assignee

Reporter

Original estimate

Time tracking

5h logged3h remaining

Priority

Time Assistant

Created January 28, 2025 at 6:40 AM
Updated April 1, 2025 at 2:53 PM

Flag notifications