Skip to content
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

Merged
merged 7 commits into from
Feb 28, 2024

Conversation

kav
Copy link
Contributor

@kav kav commented Feb 2, 2024

Allows users to provide a getPermissions function to the auth provider that works similarly to getIdentity rather than simply stubbing getPermissions

Copy link
Contributor

@slax57 slax57 left a 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!

kav and others added 2 commits February 19, 2024 11:46
Co-authored-by: Jean-Baptiste Kaiser <jbaptiste.kaiser@gmail.com>
Copy link
Contributor

@adguernier adguernier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Great work 💪

@@ -49,6 +49,22 @@ export const authProvider = supabaseAuthProvider(supabase, {
fullName: `${data.first_name} ${data.last_name}`,
};
},
getPermissions: async user => {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

kav and others added 3 commits February 22, 2024 10:38
Co-authored-by: adrien guernier <adguernier@gmail.com>
Co-authored-by: adrien guernier <adguernier@gmail.com>
@kav
Copy link
Contributor Author

kav commented Feb 22, 2024

Apologies for the lint errors I didn't notice vscode wasn't linting inline for some reason.

Copy link
Contributor

@adguernier adguernier left a 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>
Copy link
Contributor

@adguernier adguernier left a 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 :)

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition, thanks!

@kav kav requested a review from slax57 February 23, 2024 17:31
@adguernier adguernier changed the title Adding getPermissions support Add support for getPermissions Feb 28, 2024
@adguernier adguernier changed the title Add support for getPermissions Add getPermissions support in dataProvider Feb 28, 2024
@adguernier adguernier changed the title Add getPermissions support in dataProvider Add getPermissions support in authProvider Feb 28, 2024
@adguernier adguernier merged commit 056b510 into marmelab:main Feb 28, 2024
@kav kav deleted the feature/get-permissions branch February 28, 2024 19:07
@slax57 slax57 added this to the 2.2.0 milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants