-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix(core): pass meta to useCan params #6826
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: bf1be72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for refine-doc-live-previews ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
ad45f03
to
bf1be72
Compare
Hi @devarsh-mavani-19, thanks for the PR! Do you have time to add some tests? You can see the button tests here. |
@@ -43,7 +44,7 @@ export const useButtonCanAccess = ( | |||
const { data: canAccess } = useCan({ | |||
resource: props.resource?.name, | |||
action: props.action === "clone" ? "create" : props.action, | |||
params: { id: props.id, resource: props.resource }, | |||
params: { ...props.meta, id: props.id, resource: props.resource }, |
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.
can we pass this like this:
params: { ...props.meta, id: props.id, resource: props.resource }, | |
params: { meta: { ...props.meta }, id: props.id, resource: props.resource }, |
I believe we can manage better with this way
@@ -0,0 +1,7 @@ | |||
--- | |||
"@refinedev/core": major |
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.
"@refinedev/core": major | |
"@refinedev/core": patch |
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
[BUG] ShowButton does not pass meta params to useButtonCanAccess refine/inAntD #6802
What is the current behavior?
Currently it does not pass meta params to access control provider. Which limits the data that we may want to pass through useCan hook.
What is the new behavior?
Now it passes meta params through useCan hook
fixes (issue)
#6802
Notes for reviewers