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

Rework usePermissions for compatibility with Directus 11 #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JoshTheDerf
Copy link
Contributor

The usePermissions composable was completely overhauled for Directus 11, causing this extension to crash with an unexpected error on Directus 11 when used by non-Admin users.

This PR does a preliminary job of porting over the usePermissions changes to directus-extension-inline-form-interface. It hasn't been fully tested in all situations, but it does resolve the original crash when rendering the interface.

@hanneskuettner
Copy link
Owner

Thank you so much! This is a bit funny, since I'm the one of the people who implemented permissions in v11 and completely forgot about this little extension...

The only problem I see is that it copied code verbatim from the Directus repository which is licensed under BSL and can't be easily relicensed for this repo I'm afraid. I will think of a solution for that. Maybe this is the push we need to make the composables available as part of the extensions SDK 🤔

@JoshTheDerf
Copy link
Contributor Author

Hmm, that is quite a problem. I know a lot of extension developers do that, just because the internals aren't exposed, but I'm not exactly sure how to go about avoiding that for this extension. (As use-permissions.ts before was a similar situation.)

Might be something worth clarifying with the core team?

@davidpp
Copy link

davidpp commented Oct 16, 2024

Came across this PR while looking up the error after updating to Directus 11. Will fork your PR for now until the license issue is resolved. But wanted to leave a message to say thanks for both the extension from Hannes and for you taking time to fix the issue :)

@marcinkoziej
Copy link

Hi! Any updates on this? I am not sure if I should use the extension or look for alternatives (are there any?)

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.

4 participants