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

Feat add parent to resolve permissions #816

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chrisvxd
Copy link
Member

@chrisvxd chrisvxd commented Jan 20, 2025

WIP for adding parent to permission resolvers. This requires a refactor of pathData, as this is not known at the time of calculating resolvers. This will enable you to set permissions based on the parent, for example, if you wish to disable deletion of items inside a particular component

const resolvePermissions = (_, { parent }) => ({
  delete: parent?.type === 'Grid' ? false : true // Disable `delete` on this component inside components of type Grid
})

Unfortunately this is non-trivial due to the nature of DropZone remounting, and it may be better to wait for the slots API which won't require remounting.

Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
puck-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 7:27pm
puck-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 7:27pm

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.

1 participant