Class: RolePermit::Admin

Inherits:
Base
  • Object
show all
Defined in:
lib/permits.rb,
lib/generators/auth_assist/test.rb,
lib/generators/auth_assist/templates/permits.rb

Instance Attribute Summary

Attributes inherited from Base

#ability

Instance Method Summary collapse

Methods inherited from Base

#can, #cannot, #owns

Constructor Details

#initialize(ability) ⇒ Admin

Returns a new instance of Admin.



30
31
32
# File 'lib/permits.rb', line 30

def initialize(ability)
  super
end

Instance Method Details

#permit?(user, request) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
37
38
# File 'lib/permits.rb', line 34

def permit?(user)    
  super
  return if !user.role? :admin    
  can :manage, :all    
end