mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
First checkin
This commit is contained in:
parent
f207e2c8b7
commit
90b30db9e8
260 changed files with 37349 additions and 0 deletions
17
app/models/admin_ability.rb
Normal file
17
app/models/admin_ability.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class AdminAbility
|
||||
include CanCan::Ability
|
||||
|
||||
def initialize(user)
|
||||
@user = user || User.new # for guest
|
||||
@user.get_roles.each { |role| send(role.name.downcase) }
|
||||
end
|
||||
|
||||
def organizer
|
||||
can :manage, Event
|
||||
end
|
||||
|
||||
def admin
|
||||
organizer
|
||||
can :manage, :all
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue