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
feat(admin): rbac middleware #19949
feat(admin): rbac middleware #19949
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -273,7 +274,8 @@ const ProtectedEditViewPage = () => { | |||
slug: string; | |||
}>(); | |||
const [{ query }] = useQueryParams(); | |||
const { permissions = [], isLoading, isError } = useSyncRbac(slug ?? '', query, 'editView'); | |||
const {} = useRBAC; |
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.
sorry I don't understand why you are calling twice useRBAC
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.
this isn't finished 😄 it was just testing some bits!!
a28f946
to
cc2ae46
Compare
cc2ae46
to
4ff5551
Compare
Size Change: 0 B Total Size: 2.38 MB ℹ️ View Unchanged
|
4ff5551
to
0caa89f
Compare
0caa89f
to
9c3b21b
Compare
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.
Code LGTM, didn't test it though
Will this be documented somewhere?
use(middleware: RBACMiddleware[]): void; | ||
use(middleware: RBACMiddleware): void; |
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.
use(middleware: RBACMiddleware[]): void; | |
use(middleware: RBACMiddleware): void; |
Do we need those? We've got the same types below
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.
OVERLOADS
What does it do?
useAuth.checkUserHasPermissions
to return an array of permissions not a booleanuseRBAC
now returns an array of permissionsuseRBAC
now preferably wants an array and ignores keys of the object, so the action names are derived from theaction
property of thepermission
.Why is it needed?
Related issue(s)/PR(s)