FeatureFuel
1

No good way to fetch permissions or policies in hook extensions

Source: directus/directus#24865 · opened by @u12206050
Describe the Improvement


Before Directus 11, the permissions were available on the context.accountability object.
In Directus 11, this is no longer the case, and looking at the Directus code, the go to approach seems to be making use of these two functions:



As you can see though, neither is actually exported for us developers to use, this above works, but is a hack, and throws type errors.

I am aware the Permissions Items Service is available too query the raw permissions, but looking at these functions they do some smart caching which I think is very beneficial to build on top of, instead of having to reinvent the wheel.

I suggest these two functions are either added asap somewhere so we can make use of them, either via services or utils.

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests