Browse files

Suggested alternate handler for violations [ci skip]

  • Loading branch information...
1 parent 2dd589a commit 2f60ba3633a61ca0799e5f438eae5fda8bd36c2d Nathan Long committed Aug 28, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 README.markdown
@@ -366,7 +366,17 @@ Anytime a user attempts an unauthorized action, Authority calls whatever control
- Renders `public/403.html`
- Logs the violation to whatever logger you configured.
-You can specify a different handler like this:
+You can define your own `authority_forbidden` method:
+# Send 'em back where they came from with a slap on the wrist
+def authority_forbidden(exception)
+ redirect_to request.referrer.presence || root_path, :alert => 'You are not authorized to complete that action.'
+... or specify a different handler like this:
# config/initializers/authority.rb

0 comments on commit 2f60ba3

Please sign in to comment.