Added permissions for Legislation:Proposal
This commit is contained in:
@@ -14,6 +14,9 @@ module Abilities
|
||||
can :restore, Proposal
|
||||
cannot :restore, Proposal, hidden_at: nil
|
||||
|
||||
can :restore, Legislation::Proposal
|
||||
cannot :restore, Legislation::Proposal, hidden_at: nil
|
||||
|
||||
can :restore, User
|
||||
cannot :restore, User, hidden_at: nil
|
||||
|
||||
@@ -26,6 +29,9 @@ module Abilities
|
||||
can :confirm_hide, Proposal
|
||||
cannot :confirm_hide, Proposal, hidden_at: nil
|
||||
|
||||
can :confirm_hide, Legislation::Proposal
|
||||
cannot :confirm_hide, Legislation::Proposal, hidden_at: nil
|
||||
|
||||
can :confirm_hide, User
|
||||
cannot :confirm_hide, User, hidden_at: nil
|
||||
|
||||
@@ -33,7 +39,7 @@ module Abilities
|
||||
can :unmark_featured, Debate
|
||||
|
||||
can :comment_as_administrator, [Debate, Comment, Proposal, Poll::Question, Budget::Investment,
|
||||
Legislation::Question, Legislation::Annotation, Topic]
|
||||
Legislation::Question, Legislation::Proposal, Legislation::Annotation, Topic]
|
||||
|
||||
can [:search, :create, :index, :destroy], ::Administrator
|
||||
can [:search, :create, :index, :destroy], ::Moderator
|
||||
@@ -71,7 +77,8 @@ module Abilities
|
||||
can [:manage], ::Legislation::Process
|
||||
can [:manage], ::Legislation::DraftVersion
|
||||
can [:manage], ::Legislation::Question
|
||||
cannot :comment_as_moderator, [::Legislation::Question, Legislation::Annotation]
|
||||
can [:manage], ::Legislation::Proposal
|
||||
cannot :comment_as_moderator, [::Legislation::Question, Legislation::Annotation, ::Legislation::Proposal]
|
||||
|
||||
can [:create, :destroy], Document
|
||||
end
|
||||
|
||||
@@ -18,12 +18,20 @@ module Abilities
|
||||
end
|
||||
can [:retire_form, :retire], Proposal, author_id: user.id
|
||||
|
||||
can :read, Legislation::Proposal
|
||||
can :update, Legislation::Proposal do |proposal|
|
||||
proposal.editable_by?(user)
|
||||
end
|
||||
can [:retire_form, :retire], Legislation::Proposal, author_id: user.id
|
||||
|
||||
can :create, Comment
|
||||
can :create, Debate
|
||||
can :create, Proposal
|
||||
can :create, Legislation::Proposal
|
||||
|
||||
can :suggest, Debate
|
||||
can :suggest, Proposal
|
||||
can :suggest, Legislation::Proposal
|
||||
|
||||
can [:flag, :unflag], Comment
|
||||
cannot [:flag, :unflag], Comment, user_id: user.id
|
||||
@@ -34,6 +42,9 @@ module Abilities
|
||||
can [:flag, :unflag], Proposal
|
||||
cannot [:flag, :unflag], Proposal, author_id: user.id
|
||||
|
||||
can [:flag, :unflag], Legislation::Proposal
|
||||
cannot [:flag, :unflag], Legislation::Proposal, author_id: user.id
|
||||
|
||||
can [:create, :destroy], Follow
|
||||
|
||||
can [:create, :destroy, :new], Document, documentable: { author_id: user.id }
|
||||
@@ -50,6 +61,9 @@ module Abilities
|
||||
can :vote, SpendingProposal
|
||||
can :create, SpendingProposal
|
||||
|
||||
can :vote, Legislation::Proposal
|
||||
can :vote_featured, Legislation::Proposal
|
||||
|
||||
can :create, Budget::Investment, budget: { phase: "accepting" }
|
||||
can :suggest, Budget::Investment, budget: { phase: "accepting" }
|
||||
can :destroy, Budget::Investment, budget: { phase: ["accepting", "reviewing"] }, author_id: user.id
|
||||
|
||||
@@ -22,6 +22,7 @@ module Abilities
|
||||
can [:read, :changes, :go_to_version], Legislation::DraftVersion
|
||||
can [:read], Legislation::Question
|
||||
can [:create], Legislation::Answer
|
||||
can [:read, :map, :summary, :share], Legislation::Proposal
|
||||
can [:search, :comments, :read, :create, :new_comment], Legislation::Annotation
|
||||
end
|
||||
end
|
||||
|
||||
@@ -38,6 +38,15 @@ module Abilities
|
||||
can :moderate, Proposal
|
||||
cannot :moderate, Proposal, author_id: user.id
|
||||
|
||||
can :hide, Legislation::Proposal, hidden_at: nil
|
||||
cannot :hide, Legislation::Proposal, author_id: user.id
|
||||
|
||||
can :ignore_flag, Legislation::Proposal, ignored_flag_at: nil, hidden_at: nil
|
||||
cannot :ignore_flag, Legislation::Proposal, author_id: user.id
|
||||
|
||||
can :moderate, Legislation::Proposal
|
||||
cannot :moderate, Legislation::Proposal, author_id: user.id
|
||||
|
||||
can :hide, User
|
||||
cannot :hide, User, id: user.id
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ module Abilities
|
||||
merge Abilities::Moderation.new(user)
|
||||
|
||||
can :comment_as_moderator, [Debate, Comment, Proposal, Budget::Investment, Poll::Question,
|
||||
Legislation::Question, Legislation::Annotation, Topic]
|
||||
Legislation::Question, Legislation::Annotation, Legislation::Proposal, Topic]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user