Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
2c762405
Commit
2c762405
authored
13 years ago
by
Felix Schäfer
Committed by
Felix Schäfer
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix edit issue notes permission #888
parent
724bd484
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/models/issue.rb
+9
-0
9 additions, 0 deletions
app/models/issue.rb
app/models/journal.rb
+1
-1
1 addition, 1 deletion
app/models/journal.rb
vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/permissions.rb
+1
-1
1 addition, 1 deletion
...s_journalized/lib/redmine/acts/journalized/permissions.rb
with
11 additions
and
2 deletions
app/models/issue.rb
+
9
−
0
View file @
2c762405
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
app/models/journal.rb
+
1
−
1
View file @
2c762405
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/permissions.rb
+
1
−
1
View file @
2c762405
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment