Programs not supported by the facility are displayed on Stock Management screens

Description

Background: When program is not supported by user's home facility, it will still appear in the StockManagement screens and a user will see the following error messages when attempting to issue, receive or make adjustments for program that is not supported:

Expected Results:
Programs that are not supported by the facility should not be displayed in Stock Management screens

Steps to reproduce:
1. Login as administrator
2. Navigate to the Stock Management -> Adjustments, Stock Management -> Issue, Stock Management -> Receive view.
3. Try to make adjustments/issue/receive for not supported program
4. Error:

Solution:

  • The StockManagement screens should only display programs that BOTH:

    • user has rights for

    • are supported by the facility they refer to

  • Fix toString method for Program, inspect what API call could result in such error (3), it happened only once for me

  • /api/physicalInventories and /api/stockCardSummaries call /users/userId/hasRight with params: user home facility and all user programs from /api/users/programs. The API need to be made consistent , return true for /users/userId/hasRight even if program is not supported or return with /api/users/programs only programs that are supported for home facility. Might use cached permission strings instead of API calls.

Environment

None

Assignee

Unassigned

Reporter

Paweł Albecki

Labels

Story Points

3

Epic Link

Components

Priority

Major
Configure