-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add getPermissions
support in authProvider
#50
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.
Thanks for implementing this feature! 🙏
Would you mind also documenting this new parameter in the docs?
Thanks!
Co-authored-by: Jean-Baptiste Kaiser <jbaptiste.kaiser@gmail.com>
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.
praise: Great work 💪
packages/ra-supabase-core/README.md
Outdated
@@ -49,6 +49,22 @@ export const authProvider = supabaseAuthProvider(supabase, { | |||
fullName: `${data.first_name} ${data.last_name}`, | |||
}; | |||
}, | |||
getPermissions: async user => { |
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.
polish: Following the example of the getIdentity
paragraph, would you mind to mention and explain this method in the API -> The supabaseAuthProvider
section?
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.
Done, sorry I was searching the docs for getIdentity and missed the accompanying write up. Moved my example to a separate code snippet below the more detailed getIdentity
example. I can merge them if that works better.
Co-authored-by: adrien guernier <adguernier@gmail.com>
Co-authored-by: adrien guernier <adguernier@gmail.com>
Apologies for the lint errors I didn't notice vscode wasn't linting inline for some reason. |
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.
We're almost done 💪
Co-authored-by: adrien guernier <adguernier@gmail.com>
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.
Waiting for another review :)
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.
Nice addition, thanks!
getPermissions
getPermissions
getPermissions
support in dataProvider
getPermissions
support in dataProvider
getPermissions
support in authProvider
Allows users to provide a getPermissions function to the auth provider that works similarly to getIdentity rather than simply stubbing getPermissions