Module: Crystal::HttpController::Authorized::SingletonMethods
- Defined in:
- lib/rad/http_controller/acts_as/authorized.rb
Instance Method Summary collapse
Instance Method Details
#require_permission(operation, *args, &object_proc) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rad/http_controller/acts_as/authorized.rb', line 16 def operation, *args, &object_proc operation = operation.must_be.a([String, Symbol]).to_s # operation.should! :be_in, Space.permissions = args. # object_proc = args.size > 0 ? args.first : lambda{} object_proc ||= lambda{} method = "require_permission_#{operation}" define_method method do operation, instance_eval(&object_proc) end before method, end |