-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIAC-63 Introduce new permission to view all acquisition unit settings #165
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally there should be a test that shows a the actions menu is populated/empty when these permissions are/are not present.
FYI, your build is failing due to rehooks/local-storage/issues/103 but you can work around this via UIAC-70 which needs to be done for Poppy anyway.
@@ -37,13 +37,15 @@ const AcquisitionUnitDetails = ({ acquisitionUnit, close, getEditPath, deleteUni | |||
const stripes = useStripes(); | |||
|
|||
const getActionMenu = () => { | |||
return ( | |||
const isPermittedToViewActions = stripes.hasPerm('acquisitions-units.units.item.put') || stripes.hasPerm('acquisitions-units.units.item.delete'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to utilize UI permissions instead of BE ones in stripes.hasPerm/IfPermission
. In this case, the user will not accidentally get access to functionality they shouldn't from another UI permission assigned to them.
Kudos, SonarCloud Quality Gate passed! |
Purpose
https://issues.folio.org/browse/UIAC-63
Approach
Add permission to ONLY view all settings in the
acquisition-units
and protect actions from non-permitted user.Screencast
chrome_kQZAauxoaG.mp4
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.