mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Refactored proposal. Enabled cancancan
This commit is contained in:
parent
0ae7991943
commit
c982cbb88a
13 changed files with 204 additions and 231 deletions
|
|
@ -1,17 +0,0 @@
|
|||
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