Ability to default association authorizations to false rather than true #1574
Replies: 4 comments 2 replies
-
Yes. The issue is here. I had this discussion before with a few other folks, and I agree with your suggestion. One of the ideas of Avo is to have a low barrier of entry and the least amount of friction possible when you get started. That's why we default to this "loose" way of doing things (default to We should probably have an "implicit authorization" setting that would enable I'm inclined to add it to the roadmap for Avo 3, so we start fresh with it. Otherwise, it's a breaking change for everyone. They will soon start to see things disappearing from their pages. Do you agree with this approach? |
Beta Was this translation helpful? Give feedback.
-
Hey there, is there another way to do this already? I was wondering the same thing when I had four association authorizations set to false |
Beta Was this translation helpful? Give feedback.
-
Good news everyone. |
Beta Was this translation helpful? Give feedback.
-
Closing for now. Let's keep the conversation going on the PR. |
Beta Was this translation helpful? Give feedback.
-
Currently, authorization around associations defaults to true if you don't define the relevant method on the policy.
(e.g. you have a
Rubygem
resource withfield :versions, as: :has_many
, onRubygemPolicy
if you don't define a{destroy,create,show,view,etc}_versions?
then Avo will default to those beingtrue
, instead of the expectedfalse
whenraise_error_on_missing_policy = true
)I've attempted to make this safer by adding a test that all association policy methods are defined, but I'd love to be able to have Avo "fail closed" when a policy method isn't implemented.
Beta Was this translation helpful? Give feedback.
All reactions