Skip to content

Commit

Permalink
Fix editor rights
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed May 29, 2013
1 parent 7c9720a commit cb33436
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 0 additions & 6 deletions app/controllers/moderation/news_controller.rb
Expand Up @@ -72,12 +72,6 @@ def refuse
end
end

def reassign
enforce_reassign_permission(@news)
@news.reassign_to params[:user_id]
redirect_to [:moderation, @news], :notice => "L'auteur initial de la dépêche a été changé"
end

def rewrite
enforce_rewrite_permission(@news)
if @news.unlocked?
Expand Down
6 changes: 6 additions & 0 deletions app/controllers/redaction/news_controller.rb
Expand Up @@ -44,6 +44,12 @@ def update
render :partial => 'short'
end

def reassign
enforce_reassign_permission(@news)
@news.reassign_to params[:user_id]
redirect_to [:redaction, @news], :notice => "L'auteur initial de la dépêche a été changé"
end

def reorganize
if @news.lock_by(current_user)
@news.put_paragraphs_together
Expand Down
4 changes: 2 additions & 2 deletions app/views/redaction/news/_attendees.html.haml
Expand Up @@ -5,8 +5,8 @@
= list_of(attendees) do |a|
= link_to a.name, a, :title => pluralize(a.nb_editions, "édition")
- if current_account.can_reassign?(@news)
= button_to "Réattribuer", reassign_moderation_news_path(:user_id => a.id), :class => "reassign_news", :title => "Réattribuer la paternité de cette dépêche"
= button_to "Réattribuer", reassign_redaction_news_path(:user_id => a.id), :class => "reassign_news", :title => "Réattribuer la paternité de cette dépêche"
- if current_account.can_reassign?(@news)
%li
Collectif
= button_to "Réattribuer", reassign_moderation_news_path(:user_id => User.collective.id), :class => "reassign_news", :title => "Réattribuer la paternité de cette dépêche"
= button_to "Réattribuer", reassign_redaction_news_path(:user_id => User.collective.id), :class => "reassign_news", :title => "Réattribuer la paternité de cette dépêche"
2 changes: 1 addition & 1 deletion app/views/redaction/news/show.html.haml
Expand Up @@ -28,7 +28,7 @@
= button_to "Ajouter un paragraphe", redaction_news_paragraphs_path(:news_id => @news), :remote => true, :class => "add_para"

= link_to "Réorganiser", reorganize_redaction_news_path(@news), :class => "reorganize"
- if current_account.amr? || @news.submitted_by?(current_account)
- if current_account.amr? || current_account.editor? || @news.submitted_by?(current_account)
= button_to "Soumettre la dépêche", submit_redaction_news_path(@news), :class => "submit_news"
- if current_account.can_followup? @news
%button#followup Relancer les rédacteurs
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Expand Up @@ -116,6 +116,7 @@
get "/revisions/:revision" => :revision, :as => :revision
post :submit
post :followup
post :reassign
get :reorganize
put :reorganized
end
Expand All @@ -138,7 +139,6 @@
post :accept
post :refuse
post :rewrite
post :reassign
post :reset
post :ppp
get :vote
Expand Down

0 comments on commit cb33436

Please sign in to comment.