Guest User

Untitled

a guest
May 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #application.rb
  2.  
  3. class PermissionDenied < Exception
  4. #no implementation
  5. end
  6.  
  7. class ApplicationController < ActionController::Base
  8. # Let derived controllers specify their authorization policy
  9. include AuthenticatedSystem
  10.  
  11. # WTF?!? Ruby barfs here because it doesn't know about the symbol "PermissionDenied" ?!?
  12. # Same thing happens if I move the class definition inside ApplicationController
  13. rescue_from PermissionDenied { |e| http_status_code(:forbidden, e) }
  14. end
Add Comment
Please, Sign In to add comment