Module: ActsAsPrivilege
- Defined in:
- lib/acts_as_privilege.rb
Instance Method Summary collapse
- #has_privilege?(controller, action) ⇒ Boolean
- #mass_assignment_authorizer ⇒ Object
- #privilege?(route) ⇒ Boolean
Instance Method Details
#has_privilege?(controller, action) ⇒ Boolean
6 7 8 9 10 11 12 |
# File 'lib/acts_as_privilege.rb', line 6 def has_privilege?(controller, action) ActiveSupport::Deprecation.warn 'has_privilege?(controller, action) ' + 'is deprecated and may be removed from future releases, ' + 'use privilege?(route) instead.' privilege? [controller, action].join('#') end |
#mass_assignment_authorizer ⇒ Object
14 15 16 |
# File 'lib/acts_as_privilege.rb', line 14 def super + [:privilege_ids] end |
#privilege?(route) ⇒ Boolean
2 3 4 |
# File 'lib/acts_as_privilege.rb', line 2 def privilege?(route) privileges.exists?(:route => route.to_s) end |