Module: Challah::Rolls::Controller::ClassMethods
- Defined in:
- lib/challah/rolls/controller.rb
Instance Method Summary collapse
-
#restrict_to_permission(permission_key, options = {}) ⇒ Object
(also: #permission_required)
Restrict the current controller to the given permission key.
Instance Method Details
#restrict_to_permission(permission_key, options = {}) ⇒ Object Also known as: permission_required
Restrict the current controller to the given permission key. All actions in the controller will be restricted unless otherwise stated. All normal options for a before_filter are observed.
If the current user does not have the given permission key, they are shown the access denied message.
34 35 36 37 38 39 40 |
# File 'lib/challah/rolls/controller.rb', line 34 def (, = {}) before_filter() do |controller| unless controller.send(:has, ) access_denied! end end end |