-
Notifications
You must be signed in to change notification settings - Fork 64
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(ESSNTL-5253): Change required permissions for tabs #2003
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.
LGTM
@@ -9,7 +9,10 @@ const App = () => { | |||
return ( | |||
<div className="inventory"> | |||
<NotificationsPortal /> | |||
<RBACProvider appName="inventory" checkResourceDefinitions> | |||
<RBACProvider | |||
appName={null /* fetch permissions from all scopes */} |
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.
What if we extend the RBACProvider
to support something like scopes
, with *
being all?
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.
I was an author of the recent RBACProvider changes actually, and yeah, this is the good suggestion. There were some suggestions from Karel to keep it simple for now though. So there are three values accepted ATM: null for fetching all scopes, undefined for none, and string that represents the name of app and also scope.
Fixes https://issues.redhat.com/browse/ESSNTL-5253. Should be merged after RedHatInsights/frontend-components#1900 is released.
With this PR, Inventory fetches permissions for all applications, not only from the inventory scope. This way, we can read all the required permissions before rendering contents of each tab on the System details page (Advisor, Vulnerability, etc.). This also updates the list of permissions according to the stage, not prod, RBAC config, and makes exception for org. admins to always show the tab contents.
How to test
Have an account for which you can alter roles/permissions. Go to /inventory and any system's details page. Leave only the Inventory Read role, and verify that all tabs except General and Advisor are unavailable (should write no access). Try to add some viewer roles for each app and check that the tabs are now viewable.