But honestly, depending on the complexity of your logic you may not even need custom hooks. You can get really granular with the built-in access policies and permissions.
As long as you have relationships configured with the user collection you can reference those in your permissions.
Here's an example rule for accessing items within a `projects` table that hides any projects that don't belong to the current agency partner.
I wrote my own extension in version 9 some time ago where I used hooks to track changes and sync our Full-Text Search engine (Meilisearch). I just remembered some of the difficulties dealing with hooks, because their payload differed in structure depending on how data entries were mutated (update via Web-UI VS creation via API VS import via API /utils/import). Has that improved?
Hi folks - looking to get some real feedback outside of my own team / circle here - good, bad, ugly - whatever.
I'm a developer advocate at a startup. Over the last few months my team and I have been working hard to build and launch our own little content hub. We wanted to create a bunch of shows that developers find entertaining and educational.
We've gotten some really solid feedback about several of the shows but one there's one I'm on the fence about continuing. We'll start recording the next round soon and I'm need to decide whether it's worth spending more time on this particular one.
It's a parody of the old Saturday Night Live skit - Deep Thoughts by Jack Handy. So it's a very very very (haha) dry style of humor.
Of course, I think it's funny and I had a blast recording the episodes. But I'm also a mid-30s dad of three little girls so I wouldn't really call myself a "tastemaker" . I'm worried a lot of the context is lost if you're not familiar with that SNL skit.
So my question is – is this actually funny to you? Does it resonate?
Or does it just miss the mark? Waste of time to record more episodes?
It's not exactly hilarious. There's a germ of a good idea.
I think it may need tightening. The "Jack Handy" concept is deliberately slow, so you need to make each word count.
If you delivered the same gag as stand up it would take just a few seconds. As it is there's no build and no payoff to the parody of low-key motivational vid.
Here's the docs for custom hooks. https://directus.io/docs/guides/extensions/api-extensions/ho...
But honestly, depending on the complexity of your logic you may not even need custom hooks. You can get really granular with the built-in access policies and permissions.
As long as you have relationships configured with the user collection you can reference those in your permissions.
Here's an example rule for accessing items within a `projects` table that hides any projects that don't belong to the current agency partner.
{"_and":[{"partner":{"id":{"_eq":"$CURRENT_USER.agency_partner_id.id"}}}]}
Each project a many to one relationship to agency_partners. Each user has a many to one relationship to agency_partners.
You can even scope this down to allow / hide specific fields if you want.