@@ -58,6 +58,13 @@ class Issue < ActiveRecord::Base
...
@@ -58,6 +58,13 @@ class Issue < ActiveRecord::Base
attributes
attributes
end
end
defself.visible_to_user(user)
returnwhere(confidential: false)ifuser.blank?
returnallifuser.admin?
where('issues.confidential = false OR (issues.confidential = true AND (issues.author_id = :user_id OR issues.assignee_id = :user_id OR issues.project_id IN(:project_ids)))',user_id: user.id,project_ids: user.authorized_projects.select(:id))