]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/issues_controller.rb
Merge remote-tracking branch 'upstream/pull/2000'
[rails.git] / app / controllers / issues_controller.rb
index 72952894624195f734efc61925c363492a458c22..d4e9a3bdfa4bec2c7e745b200c67e52a307ff086 100644 (file)
@@ -2,6 +2,7 @@ class IssuesController < ApplicationController
   layout "site"
 
   before_action :authorize_web
+  before_action :set_locale
   before_action :require_user
   before_action :check_permission
   before_action :find_issue, :only => [:show, :resolve, :reopen, :ignore]
@@ -14,7 +15,7 @@ class IssuesController < ApplicationController
     @issue_types.concat %w[DiaryEntry DiaryComment User] if current_user.administrator?
 
     @users = User.joins(:roles).where(:user_roles => { :role => current_user.roles.map(&:role) }).distinct
-    @issues = Issue.where(:assigned_role => current_user.roles.map(&:role))
+    @issues = Issue.visible_to(current_user)
 
     # If search
     if params[:search_by_user] && params[:search_by_user].present?