X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6bcffbf49970b6d8c27f2a9561eec365aa590ea9..283cffdfdbbe31f0a5e6a9dc52b35a8c93a28fb1:/app/controllers/issues_controller.rb?ds=sidebyside diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 10b626cd1..c2470dc5b 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -11,12 +11,11 @@ class IssuesController < ApplicationController if current_user.moderator? @issue_types = %w[Note] - @users = User.joins(:roles).where(:user_roles => { :role => "moderator" }) else @issue_types = %w[DiaryEntry DiaryComment User] - @users = User.joins(:roles).where(:user_roles => { :role => "administrator" }) end + @users = User.joins(:roles).where(:user_roles => { :role => current_user.roles.map(&:role) }).distinct @issues = Issue.where(:assigned_role => current_user.roles.map(&:role)) # If search