Module: BravoGuard::Controller
- Defined in:
- lib/bravo_guard/controller.rb
Instance Method Summary collapse
-
#authorise!(options = {}) ⇒ Object
nodoc.
-
#authoriser ⇒ Object
nodoc.
-
#permission ⇒ Object
nodoc.
Instance Method Details
#authorise!(options = {}) ⇒ Object
nodoc
5 6 7 8 9 |
# File 'lib/bravo_guard/controller.rb', line 5 def (={}) return if .allows?(current_user, *) err = .inspect raise BravoGuard::PermissionDenied, err end |
#authoriser ⇒ Object
nodoc
13 14 15 16 17 |
# File 'lib/bravo_guard/controller.rb', line 13 def return resource_class.new if action_name == 'index' build_resource if ['new', 'create'].include?(action_name) resource end |
#permission ⇒ Object
nodoc
21 22 23 |
# File 'lib/bravo_guard/controller.rb', line 21 def action_name end |