-
Notifications
You must be signed in to change notification settings - Fork 420
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
Fix user authorization issues with admin sidebar #1999
Fix user authorization issues with admin sidebar #1999
Conversation
The issue described at DSpace#1643 was no longer reproducible: The menu component ultimately retrieves menu section information from the store, but in the `MenuComponent#ngOnInit` method, this information is piped through `distinctUntilChanged(compareArraysUsingIds())`, which discards an update that sets these menu elements to be visible. The behavior of this pipe is probably incorrect, but a proper fix is out of scope for the current task. For now, we work around the problem by adding top-level menu sections _after_ their children while initializing the menu section store, which side-steps this issue.
See DSpace#1643 Sidebar now omits "New" and/or "Edit" options in the sidebar if the user does not have permissions to respectively create new Items or edit Items. If this results in an empty sidebar, the sidebar is hidden in its entirety.
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.
👍 Thanks @KoenP ! I tested this with the backend PR and found that it works for full Admin, Comm Admin, Coll Admin, Submitter and a user with no privileges. The menu options all look correct now.
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.
thanks @KoenP for this PR
LGTM
Merging as this PR & the corresponding backend PR are both now at +2. Thanks again @KoenP ! |
References
Description
Instructions for Reviewers
List of changes in this PR:
canSubmit
andcanEditItem
authorizations to determine whether to add the corresponding sections to the admin sidebar for a logged-in user.To test
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.