https://avo.cool logo
Hi everyone, how are you? How can I configure ...
# resources
m
Hi everyone, how are you? How can I configure an AVO resource to just have show and index views, without allowing deletion, edition, or creation? And more importantly, where is this in the docs? I was unable to find it.
m
Thread automatically created by Bruno Costanzo in #1141725701549072486
l
Hi @magnificent-jackal-1244 You can achieve that with authorization https://docs.avohq.io/3.0/authorization.html For your use case you only need to define
destroy?
,
edit?
,
update?
and
new?
and
create?
to
false
PRO TIP for organization: If you have several resources implementing this behavior, you can create a policy class that defines the methods and call it something like “ViewOnly.” This class can inherit from the AppPolicy, and any resource policy you want to make view-only can simply inherit from the ViewOnly class.
m
Thanks @loud-jewelry-99127 🙂 We are still waiting for the organization to buy the pro license (they depend on another stakeholder so it's taking some time) But it is good to know because we already incorporated AVO as the full admin interface, so this is going to help pushing the decision.
l
Anytime!