Hey everyone,
I wanted to get your opinion about right checks for the following endpoints:
GET /validReasons
GET /validSources
GET /validDestinations
On the fulfillment UI, we are currently using the /validReasons endpoint to fetch all the reasons the user can use to reject the received stock on the proof of delivery page. Unfortunately, only users that have administration rights for reasons, sources and destinations can view all of them. Other users can only query for resources at the facility type that matches their home facility type and for programs that is supported at their home facility. This means that we currently cannot display users the rejection reasons unless they have got the admin right assigned OR both the facility type happens to match their home facility type AND the given program is supported at user's home facility (neither of which needs to be the case).
I wanted to propose removing this restriction to view reasons, sources and destinations and allow all logged users to query for them at any facility type and program. This would only affect VIEWING the resource (aka GET). Managing them (POST, DELETE) would still be restricted to the administration rights as it currently is.
Note 1: We only use /validReasons on the Fulfillment UI - but since the permission check logic is the same for all of them, I think it makes sense to have it consistent for all of them
Note 2: If we don't want to unrestrict those GETs, how else do we want to handle this? I don't think we should assume users will only manage PODs at their home facility.
Thoughts?
Best regards,
Sebastian.
···
–
Sebastian Brudziński
Senior Software Developer / Team Leader
sbrudzinski@soldevelo.com
SolDevelo Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41