Module: DynamicAcl
- Defined in:
- lib/dynamic_acl/engine.rb
Defined Under Namespace
Classes: Engine
Class Method Summary collapse
Class Method Details
.can?(record, action, object, user_id = nil) ⇒ Boolean
5 6 7 |
# File 'lib/dynamic_acl/engine.rb', line 5 def self.can?(record, action, object, user_id=nil) ::Acl.where(user_type: record.user_type, user_id: user_id, action: action, object_type: object.class.name, state: object.state).first.present? end |