Adds an issues visibility level on roles (#7412).

It can be set so that users only see their own issues (created or assigned).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5416 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-04-11 17:53:15 +00:00
parent 5fd891aa72
commit aa0d01b3d9
12 changed files with 132 additions and 19 deletions
+7
View File
@@ -174,6 +174,13 @@ class Project < ActiveRecord::Base
if statement_by_role.empty?
"1=0"
else
if block_given?
statement_by_role.each do |role, statement|
if s = yield(role, user)
statement_by_role[role] = "(#{statement} AND (#{s}))"
end
end
end
"((#{base_statement}) AND (#{statement_by_role.values.join(' OR ')}))"
end
end