summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-22 10:30:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-22 10:30:42 +0000
commitbda9b98a562eba802e00781c355cbade50f3d267 (patch)
tree6a11abfde7b80e67607d75c28d4d3ff850787d38 /app/models/issue.rb
parentcd437b7e1dd3f2772bd712f543ce33ee16a4eff6 (diff)
downloadredmine-bda9b98a562eba802e00781c355cbade50f3d267.tar.gz
redmine-bda9b98a562eba802e00781c355cbade50f3d267.zip
Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11068 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 7f2996fd6..2d9228b1d 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -134,6 +134,11 @@ class Issue < ActiveRecord::Base
end
end
+ # Returns true if user or current user is allowed to edit or add a note to the issue
+ def editable?(user=User.current)
+ user.allowed_to?(:edit_issues, project) || user.allowed_to?(:add_issue_notes, project)
+ end
+
def initialize(attributes=nil, *args)
super
if new_record?