-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Access control: pessimistic rendering in CRUD views #10258
Access control: pessimistic rendering in CRUD views #10258
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.
That's great! Now apps with a slow checkAuth
won't reveal anything in CRUD pages.
The UX is a bit different for the Dashboard, as users don't see the Loading page while auth is checked. Is there a way to make this view consistent with the others?
} | ||
|
||
return ( | ||
<OptionalResourceContextProvider value={controllerProps.resource}> |
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.
<OptionalResourceContextProvider value={controllerProps.resource}> | |
<OptionalResourceContextProvider value={props.resource}> |
Otherwise it's a BC. Same for other controllers.
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.
No because the controller already handles it
@@ -81,6 +82,7 @@ export const Create = < | |||
disableAuthentication={disableAuthentication} | |||
hasEdit={hasEdit} | |||
hasShow={hasShow} | |||
loading={defaultLoading} |
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.
<Create>
should allow overriding the loading
component. Same for the others.
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.
Stupid me
Yes, by wrapping user provided dashboard in another component |
Problem
All CRUD views currently starts to render optimistically even though authentication and optionally authorization checks are pending. This is a security issue.
Solution
Make sure the base components for all CRUD views verify that no auth checks are pending before rendering.
Introduce a loading prop accepting a ReactNode on those components that is displayed while auth checks are pending.
How To Test
Describe the steps required to test the changes
Additional Checks
master
for a bugfix, ornext
for a feature