Module: Racl::InstanceMethods
- Defined in:
- lib/racl.rb
Instance Method Summary collapse
-
#can(privilege, model_name) ⇒ Object
Checks permissions for a specific action on a specific model Return true if no acl_model was defined in the acl_models table or if the user has the privilege on the given model_name.
Instance Method Details
#can(privilege, model_name) ⇒ Object
Checks permissions for a specific action on a specific model Return true if no acl_model was defined in the acl_models table or if the user has the privilege on the given model_name
17 18 19 20 21 22 23 |
# File 'lib/racl.rb', line 17 def can privilege, model_name return false unless logged_in? access = true privilege = current_user.privileges.find(:model_name => model_name.to_s, :privilege => privilege.to_s) access = true if privilege access end |