Permissions error updating CCE functional status at my facility

Description

Summary
If the user "rivo" tries to set a non-functional Functionality Status of a CCE item at their home facility, Depósito Provincial Niassa, they receive an error:

"There was an error with this request, please contact the server administrator.
There is no supervisory node for program 418bdc1d-c303-4bd0-b2d3-d8901150a983 and facility 0898dcd6-53f2-41b6-ba7d-b2f5122ffb44"

Found this bug during test case during execution round "3.3 RC Phase 1 - second round (correct one)"

Steps to Reproduce
1. Follow all steps in (log in as "rivo", navigate to CCE Management > CCE Inventory, click Search to search at home facility, Depósito Provincial Niassa with EPI program)
2. Click edit on a CCE inventory item that is already functioning, such as Fridge #12. Change functionality status to "Awaiting Repair" or "Unserviceable". Choose a reason and, if prompted, a decommission date.
3. Click Update to save your changes.
4. ERROR: error message appears and your changes are not saved:

"There was an error with this request, please contact the server administrator.
There is no supervisory node for program 418bdc1d-c303-4bd0-b2d3-d8901150a983 and facility 0898dcd6-53f2-41b6-ba7d-b2f5122ffb44"

Note that saving WORKS if you are changing to Functioning. Issue reported on Chrome on UAT on April 17, 2018.

Root Cause
Is this an error in our permissions handling or in demo data? TBD

Q: Would it only impact "rivo" or impact any country users?
A: This error can impact other users that have home facility not associated with any supervisory node (by requisition groups)

Q: Why does the error only happen for non-functioning status (is the permissions problem happening when it goes to manipulate the reason?)
A: Error is only happening for non-functioning status because we send email about non-functioning device to users with inventory edit rights for given program and facility. What is happening in details:
1. rivo create inventory because it has required rights (CCE_INVENTORY_EDIT for home facility and given program)
2. there is no validation that "rivo can't create inventory because there is no facility in Requisition Group for any supervisory node"
4. rivo change status to non-functioning because it has required rights (CCE_INVENTORY_EDIT for home facility and given program)
5. System tries to send notification but it fails (can't find supervisory node for facility)

Acceptance Criteria

  • Need to determine source problem, fix it, perhaps add automated test

  • we shouldn't be throwing an exception if supervisory node is not found. There's no such requirement when creating inventory item. If there's no SN, we just do not search for users at this SN.

Environment

None

Attachments

2

QAlity Plus - Test Management

Checklists

Activity

Joanna Bebak 
April 20, 2018 at 6:27 AM

I created a ticket for the above-mentioned issue: OLMIS-4601.

Joanna Bebak 
April 19, 2018 at 2:13 PM

It turned out that the above-mentioned issue is not related to this ticket. I'll create a new one for it.

Paweł Albecki 
April 19, 2018 at 2:13 PM
(edited)

Niassa province approval point doesn't have Deposito Provincial Niassa in Requisition Group. Feel free to open new ticket if this is wrong (demo data issue)

Joanna Bebak 
April 19, 2018 at 1:49 PM

I checked, and changing the functional status as rivo doesn't cause errors anymore. I noticed only the same thing as Sam mentioned above - administrator can't see Deposito Provincial Niassa in the drop-down on the CCE Inventory screen. I see that the user has the CCE Inventory Manager role at Niassa province approval point, so I think he should be able to choose this facility from the drop-down. Am I right? And if so, should I create a new ticket for this issue?

Paweł Albecki 
April 19, 2018 at 11:38 AM

Make sense, I will add required checks.
New ticket about no notification for user with home facility

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

Details

Assignee

Reporter

Labels

Story Points

Original estimate

Time tracking

1d 2h logged2h remaining

Components

Sprint

Fix versions

Affects versions

Priority

Time Assistant

Created April 17, 2018 at 11:47 PM
Updated April 24, 2018 at 8:36 PM
Resolved April 19, 2018 at 2:13 PM