Skip to content

Commit

Permalink
authorisation check to request_title_change method
Browse files Browse the repository at this point in the history
  • Loading branch information
ViditChitkara committed Jan 14, 2018
1 parent 61e5383 commit 06b292b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ def rsvp

def request_title_change
node = Node.find params[:id].to_i
unless current_user && current_user.drupal_user == node.author
flash.keep[:error] = I18n.t('notes_controller.author_can_edit_note')
redirect_to :back
end
node.update(title: params[:title])
redirect_to node.path + "#comments"
end
Expand Down

0 comments on commit 06b292b

Please sign in to comment.