Merge branch 'master' into site-customization

This commit is contained in:
Amaia Castro
2017-04-07 17:29:33 +02:00
279 changed files with 9351 additions and 464 deletions

View File

@@ -32,7 +32,7 @@ module Abilities
can :mark_featured, Debate
can :unmark_featured, Debate
can :comment_as_administrator, [Debate, Comment, Proposal, Budget::Investment]
can :comment_as_administrator, [Debate, Comment, Proposal, Poll::Question, Budget::Investment]
can [:search, :create, :index, :destroy], ::Moderator
can [:search, :create, :index, :summary], ::Valuator
@@ -50,8 +50,17 @@ module Abilities
can :create, Budget::ValuatorAssignment
can [:search, :edit, :update, :create, :index, :destroy], Banner
can [:index, :create, :edit, :update, :destroy], Geozone
can [:read, :create, :update, :destroy, :add_question, :remove_question, :search_booths, :search_questions, :search_officers], Poll
can [:read, :create, :update, :destroy], Poll::Booth
can [:search, :create, :index, :destroy], ::Poll::Officer
can [:create, :destroy], ::Poll::BoothAssignment
can [:create, :destroy], ::Poll::OfficerAssignment
can [:read, :create, :update], Poll::Question
can :destroy, Poll::Question # , comments_count: 0, votes_up: 0
can :manage, SiteCustomization::Page
can :manage, SiteCustomization::Image
can :manage, SiteCustomization::ContentBlock

View File

@@ -53,6 +53,12 @@ module Abilities
can :create, DirectMessage
can :show, DirectMessage, sender_id: user.id
can :answer, Poll do |poll|
poll.answerable_by?(user)
end
can :answer, Poll::Question do |question|
question.answerable_by?(user)
end
end
can [:create, :show], ProposalNotification, proposal: { author_id: user.id }

View File

@@ -6,6 +6,8 @@ module Abilities
can [:read, :map], Debate
can [:read, :map, :summary], Proposal
can :read, Comment
can :read, Poll
can :read, Poll::Question
can [:read, :welcome], Budget
can :read, Budget::Investment
can :read, SpendingProposal

View File

@@ -5,7 +5,7 @@ module Abilities
def initialize(user)
self.merge Abilities::Moderation.new(user)
can :comment_as_moderator, [Debate, Comment, Proposal, Budget::Investment]
can :comment_as_moderator, [Debate, Comment, Proposal, Budget::Investment, Poll::Question]
end
end
end