Module: Rad::Controller::Authorized::ClassMethods
- Defined in:
- lib/kit/controller/authorized.rb
Instance Method Summary collapse
Instance Method Details
#require_permission(operation, *args, &object_proc) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/kit/controller/authorized.rb', line 7 def operation, *args, &object_proc operation.must_be.a Symbol = args. # object_proc = args.size > 0 ? args.first : lambda{} object_proc ||= lambda{|controller|} method = "require_permission_#{operation}".to_sym define_method method do operation, instance_eval(&object_proc) end before method, end |