Skip to content
Snippets Groups Projects
Commit 2c762405 authored by Felix Schäfer's avatar Felix Schäfer Committed by Felix Schäfer
Browse files

Fix edit issue notes permission #888

parent 724bd484
Branches
Tags
No related merge requests found
......@@ -707,6 +707,15 @@ class Issue < ActiveRecord::Base
projects
end
# Overrides Redmine::Acts::Journalized::Permissions
#
# The default assumption is that journals have the same permissions
# as the journaled object, issue notes have separate permissions though
def journal_editable_by?(journal, user)
return true if journal.author == user && user.allowed_to?(:edit_own_issue_notes, project)
user.allowed_to? :edit_issue_notes, project
end
private
def update_nested_set_attributes
......
......@@ -76,7 +76,7 @@ class Journal < ActiveRecord::Base
end
def editable_by?(user)
journaled.journal_editable_by?(user)
journaled.journal_editable_by?(self, user)
end
def details
......
......@@ -22,7 +22,7 @@ module Redmine::Acts::Journalized
module Permissions
# Default implementation of journal editing permission
# Is overridden if defined in the journalized model directly
def journal_editable_by?(user)
def journal_editable_by?(journal, user)
return true if user.admin?
if respond_to? :editable_by?
editable_by? user
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment