Is it possible to prevent any direct use of Ash resource?

Hi sorry i could not this in document, I want to create a policy (not ash policy) to notice developers!! they just must call domain and any query with resource in out of resource for example in LiveView is forbidden! is there any option? it is like create boundary Thank you in advance
Solution:
No, there is no real way to prevent directly calling the resource.
Jump to solution
3 Replies
Solution
ZachDaniel
ZachDaniel3mo ago
No, there is no real way to prevent directly calling the resource.
ZachDaniel
ZachDaniel3mo ago
Well..I mean you could do this:
define :something, default_options: [context: %{allowed?: true}]
define :something, default_options: [context: %{allowed?: true}]
and then write a policy that checks the context for example but nothing stops a developer from just setting that context
RootCA
RootCA3mo ago
Not an Ash specific answer: depending on the situation, you might be able to use the general purpose Boundary hex package: https://hexdocs.pm/boundary/Boundary.html

Did you find this page helpful?