authorization with cancancan
This commit is contained in:
parent
4af0e59ca6
commit
c3ed57e3e9
34 changed files with 538 additions and 500 deletions
11
app/models/admin_ability.rb
Normal file
11
app/models/admin_ability.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class AdminAbility
|
||||
include CanCan::Ability
|
||||
|
||||
def initialize(user)
|
||||
user ||= User.new # for guest
|
||||
if user.role?('Conference Admin')
|
||||
can :manage, :all
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue