FeatureFuel
1

A way for a hook to identify root calls

Source: directus/directus#24645 · opened by @alexey-yarmosh
Summary Is there a way for hook extension to define that item update comes from the app itself (root permissions), not from the API call? Basic Example E.g. I have a validation hook. I want to validate by default, but if it is a call from (new ItemsService()).updateOne() defined in another extension (created without accountability => with root permissions) I want to ignore the validation: Motivation Basically it is like an { emitEvents: false } parameter. But I want it to be resolved on a hook level instead of adding { emitEvents: false } in every item update call. Detailed Design It can be a field inside accountability object. Requirements List Must Have: • explicit field to identify root permissions Drawbacks No Alternatives It looks like in some cases if accountability === null it may be considered as root privileges, but it is too implicit and easy to mix up with accountability.user === null. Since such a mix up may result in a big security hole I thin…

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