Module: ActsAsPrivilege

Defined in:
lib/acts_as_privilege.rb

Instance Method Summary collapse

Instance Method Details

#has_privilege?(controller, action) ⇒ Boolean

Returns:

  • (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_authorizerObject



14
15
16
# File 'lib/acts_as_privilege.rb', line 14

def mass_assignment_authorizer
  super + [:privilege_ids]
end

#privilege?(route) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/acts_as_privilege.rb', line 2

def privilege?(route)
  privileges.exists?(:route => route.to_s)
end