-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Core Data: Add canRead to useResourcePermissions #43484
Conversation
Size Change: -146 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
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.
Thank you for adding the missing handling for the read
permission. Code looks good to me 👍🏻
@@ -152,7 +172,7 @@ export default function useResourcePermissions< IdType = void >( | |||
|
|||
export function __experimentalUseResourcePermissions( | |||
resource: string, | |||
id?: IdType | |||
id?: unknown |
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.
Is that change necessary? The type of the stable method didn't change.
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.
The stable method has a generic IdType
parameter while this one doesn't.
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.
I really need to learn more about TypeScript 🙈
Feel free to land this PR 😄
What?
Adds
canRead
property to theuseResourcePermissions
hook. WordPress permissions involvecreate
,update
,delete
, andread
actions, and that last one was missing.Testing Instructions
Confirm the tests are green
cc @gziolo @Mamaduka