avo-hq / avo

Build Ruby on Rails apps 10x faster
https://avohq.io
Other
1.53k stars 255 forks source link

Hook on unauthorized policy #3146

Closed Paul-Bob closed 1 month ago

Paul-Bob commented 3 months ago

For this feature, I can imagine a hook somewhere in the avo.rb or application_policy.rb. Basically the developer does whatever he wants inside that block, we just need to call this hook on unauthorized action

config.on_unauthorized_policy = ->(policy_class, action, record, user)
  # can log in console
  # can log in file
  # can send notification
  # can do whatever he wants
end

I guess we should not decide, who and where to see what, because each case is a different case, and each developer team should make the best decision for their app.

Originally posted by @Paul-Bob in https://github.com/avo-hq/avo-pro/issues/86#issuecomment-2289875628

github-actions[bot] commented 2 months ago

This issue has been marked as stale because there was no activity for the past 15 days.

github-actions[bot] commented 2 months ago

Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️

adrianthedev commented 1 month ago

Closing for now until we see further feedback/research on this.