-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use useResourcePermissions in block-library and the widgets editor #43305
Conversation
Size Change: +691 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Code changes look good. I'm wondering what would be the best way to test changes applied, any ideas? The refined API for the use cases covered in this PR looks way better than before: const { canCreate: userCanCreatePages } = useResourcePermissions( 'pages' ); The variable aliasing is still something that isn't ideal, but it could also be coded in an alternative way: const pagesPermissions = useResourcePermissions( 'pages' );
// then in the code
pagesPermissions.canCreate ? 'yes' : 'no'; I guess it gives enough flexibility for start 👍🏻 |
@gziolo I like your suggestion and I added these names as you proposed. |
What?
Applies the newly stabilized useResourcePermissions hook to other places in the repository.