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

Make authProvider.getPermissions optional #10257

Merged

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Oct 4, 2024

Problem

Even though using permissions in React-Admin is optional, the AuthProvider type required users to implement the getPermissions method.

Solution

Make the getPermissions method optional.
This also allows us to optimize the usePermissions hook.

Part of #10222

How To Test

Stories and tests

Additional Checks

  • The PR targets master for a bugfix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

@fzaninotto fzaninotto merged commit 86f1474 into access-control-resources Oct 4, 2024
14 checks passed
@fzaninotto fzaninotto deleted the optional-authprovider-getpermissions branch October 4, 2024 09:32
@fzaninotto fzaninotto added this to the 5.3.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants