This feature wasn't properly tested nor reviewed, and after reviewing
several pull requests with a similar status and considering this pull
request is related to the public area of the web, we've decided to
remove it before releasing version 1.1.
This commit reverts commit 4f50e67a.
35 lines
1.3 KiB
Ruby
35 lines
1.3 KiB
Ruby
module Abilities
|
|
class Everyone
|
|
include CanCan::Ability
|
|
|
|
def initialize(user)
|
|
can [:read, :map], Debate
|
|
can [:read, :map, :summary, :share], Proposal
|
|
can :read, Comment
|
|
can :read, Poll
|
|
can :results, Poll do |poll|
|
|
poll.expired? && poll.results_enabled?
|
|
end
|
|
can :stats, Poll do |poll|
|
|
poll.expired? && poll.stats_enabled?
|
|
end
|
|
can :read, Poll::Question
|
|
can :read, User
|
|
can [:read, :welcome], Budget
|
|
can [:read], Budget
|
|
can [:read], Budget::Group
|
|
can [:read, :print, :json_data], Budget::Investment
|
|
can(:read_results, Budget) { |budget| budget.results_enabled? && budget.finished? }
|
|
can(:read_stats, Budget) { |budget| budget.stats_enabled? && budget.valuating_or_later? }
|
|
can :read_executions, Budget, phase: "finished"
|
|
can :new, DirectMessage
|
|
can [:read, :debate, :draft_publication, :allegations, :result_publication,
|
|
:proposals, :milestones], Legislation::Process, published: true
|
|
can [:read, :changes, :go_to_version], Legislation::DraftVersion
|
|
can [:read], Legislation::Question
|
|
can [:read, :map, :share], Legislation::Proposal
|
|
can [:search, :comments, :read, :create, :new_comment], Legislation::Annotation
|
|
end
|
|
end
|
|
end
|