Class: Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
app/models/ability.rb

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.



14
15
16
17
18
19
20
# File 'app/models/ability.rb', line 14

def initialize(user)
  can :create, EgovUtils::User if user.has_role?('anonymous') && EgovUtils::Settings.allow_register?

  user.all_roles.each do |role|
    role.define_abilities(self, user)
  end
end