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.
Comments
Similar requests
Add hook "context" information
18 votes · 0 comments
Configurable hook execution order for extensions
3 votes · 0 comments
When setting a Root Folder in a file/image field, we still have access to All Files, My Files and Recent Files.
1 vote · 0 comments
Enable PATCH Endpoint to Accept Arrays for Bulk Updates (Update Many Items with Unique Values Using Unique Key, Composite Key, or Query)
7 votes · 0 comments
need to add calling and chat option in my crm
1 vote · 0 comments
No comments yet.