X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/37e6725d2d85e92df4bc770b73e137a52afb63a4..ef5352332e02c2f3a9c9d5cc7594ec8da02cb64e:/app/controllers/diary_entries_controller.rb diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index 1a888547d..eaf6ddf9c 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -125,7 +125,7 @@ class DiaryEntriesController < ApplicationController @title = t "diary_entries.edit.title" @diary_entry = DiaryEntry.find(params[:id]) - if current_user != @diary_entry.user || + if cannot?(:update, @diary_entry) || (params[:diary_entry] && @diary_entry.update(entry_params)) redirect_to diary_entry_path(@diary_entry.user, @diary_entry) else