Skip to content

Commit 2ae72ed

Browse files
committed
fix permission check to allow setting the location in case only add_issues is allowed
1 parent 407f972 commit 2ae72ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/redmine_gtt/patches/issue_patch.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ def self.apply
99
Issue.prepend GeojsonAttribute
1010
Issue.class_eval do
1111
safe_attributes "geojson",
12-
if: ->(issue, user){ user.allowed_to?(:edit_issues, issue.project)}
12+
if: ->(issue, user){
13+
perm = issue.new_record? ? :add_issues : :edit_issues
14+
user.allowed_to? perm, issue.project
15+
}
1316
end
1417
end
1518
end

0 commit comments

Comments
 (0)