-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
administrator.rb
41 lines (28 loc) · 991 Bytes
/
administrator.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Abilities
class Administrator
include CanCan::Ability
def initialize(user)
self.merge Abilities::Moderation.new(user)
can :restore, Comment
cannot :restore, Comment, hidden_at: nil
can :restore, Debate
cannot :restore, Debate, hidden_at: nil
can :restore, Proposal
cannot :restore, Proposal, hidden_at: nil
can :restore, User
cannot :restore, User, hidden_at: nil
can :confirm_hide, Comment
cannot :confirm_hide, Comment, hidden_at: nil
can :confirm_hide, Debate
cannot :confirm_hide, Debate, hidden_at: nil
can :confirm_hide, Proposal
cannot :confirm_hide, Proposal, hidden_at: nil
can :confirm_hide, User
cannot :confirm_hide, User, hidden_at: nil
can :comment_as_administrator, [Debate, Comment, Proposal]
can [:search, :create, :index, :destroy], ::Moderator
can :manage, Annotation
can :manage, SpendingProposal
end
end
end