-
Notifications
You must be signed in to change notification settings - Fork 174
ROX-13378: Access Control page permissions #3720
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
Changes from all commits
f31039f
f66ab8b
b2f7fd8
9b2d4cf
220e216
731f8a9
fc39fd6
bc73c5c
4ebe7a7
6113b92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ import { | |
| getIsValidRules, | ||
| } from './accessScopes.utils'; | ||
| import AccessScopeForm from './AccessScopeForm'; | ||
| import usePermissions from '../../../hooks/usePermissions'; | ||
|
|
||
| export type AccessScopeFormWrapperProps = { | ||
| isActionable: boolean; | ||
|
|
@@ -45,6 +46,8 @@ function AccessScopeFormWrapper({ | |
| }: AccessScopeFormWrapperProps): ReactElement { | ||
| const [isSubmitting, setIsSubmitting] = useState(false); | ||
| const [alertSubmit, setAlertSubmit] = useState<ReactElement | null>(null); | ||
| const { hasReadWriteAccess } = usePermissions(); | ||
| const hasWriteAccessForPage = hasReadWriteAccess('Role') && hasReadWriteAccess('Access'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker to merge, but for my understanding: does access scope require The following function calls which require
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pedrottimark that's our agreement with @rukletsov(if I got it right): bring |
||
|
|
||
| // Disable Save button while editing label selectors. | ||
| const [labelSelectorsEditingState, setLabelSelectorsEditingState] = | ||
|
|
@@ -127,7 +130,7 @@ function AccessScopeFormWrapper({ | |
| <Button | ||
| variant="primary" | ||
| onClick={handleEdit} | ||
| isDisabled={action === 'edit'} | ||
| isDisabled={!hasWriteAccessForPage || action === 'edit'} | ||
| isSmall | ||
| > | ||
| Edit access scope | ||
|
|
||
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 would have probably kept the check extending it to
hasReadAccess('Access') || hasReadAccess('Role')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.
In theory
But if future improvement in resources means that Access is the only dependency for all 4 entities, then we will move resource dependency from container code to declarative description of routes. Therefore,
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 think currently(meaning until after
Accessis fused withRole+with changes in this PR) we get reasonable behaviour when giving userAccessbut noRolepermission: