Class: RolePermit::Moderator

Inherits:
Base
  • Object
show all
Defined in:
lib/permits.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) ⇒ Moderator

Returns a new instance of Moderator.



63
64
65
# File 'lib/permits.rb', line 63

def initialize(ability)
  super
end

Instance Method Details

#permit?(user, request) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
70
71
72
# File 'lib/permits.rb', line 67

def permit?(user)
  super
  return if !user.role?(:moderator)
  can :read, :all      
  # owns(user, Comment)
end