Add new Proposal share endpoint, plus ability for ereryone to use it
This commit is contained in:
@@ -45,6 +45,9 @@ class ProposalsController < ApplicationController
|
|||||||
def retire_form
|
def retire_form
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def share
|
||||||
|
end
|
||||||
|
|
||||||
def vote_featured
|
def vote_featured
|
||||||
@proposal.register_vote(current_user, 'yes')
|
@proposal.register_vote(current_user, 'yes')
|
||||||
set_featured_proposal_votes(@proposal)
|
set_featured_proposal_votes(@proposal)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module Abilities
|
|||||||
|
|
||||||
def initialize(user)
|
def initialize(user)
|
||||||
can [:read, :map], Debate
|
can [:read, :map], Debate
|
||||||
can [:read, :map, :summary], Proposal
|
can [:read, :map, :summary, :share], Proposal
|
||||||
can :read, Comment
|
can :read, Comment
|
||||||
can :read, Poll
|
can :read, Poll
|
||||||
can :read, Poll::Question
|
can :read, Poll::Question
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ Rails.application.routes.draw do
|
|||||||
put :flag
|
put :flag
|
||||||
put :unflag
|
put :unflag
|
||||||
get :retire_form
|
get :retire_form
|
||||||
|
get :share
|
||||||
patch :retire
|
patch :retire
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
|
|||||||
Reference in New Issue
Block a user