Hi Guys, I am struggling with the documentation, ...
# avo-2
s
Hi Guys, I am struggling with the documentation, I could not find any Information about the action policies. How do I control the visibility of actions with the resource policy, All I could find is the usage of the act_on? Method, which only show or hide the action button. Appreciate any hint. And by the way, you guys are doing an amazing job @lemon-wall-20836 and other guys , Congratulation
l
You have two ways of controlling the visibility for actions:
1. total control show/hide using the
act_on?
policy method. that will hide all actions for a resource
2. granular control using the
visibility
option on the action class https://docs.avohq.io/2.0/actions.html#actions-visibility
this way you can set each action's visiblity level
s
Thanks a lot Adrian, I was expecting the visibility of the actions to be controlled through policies in the same manner as other default methods . Something like my_super_action? Method in my resource policy should control the visibility of MySuperAction. Passing the block with this logic is in fact the same, this maybe something could be moved up to the base action class. But I get the point 🙂 thanks a lot man
l
yeah. I agree the "authorization" functionality is a bit scattered with actions. I'd love to bring all of it together. Probably in avo 3.0 🙂
thanks for writing!
3 Views