Patch by Pavel Rosický.
git-svn-id: https://svn.redmine.org/redmine/trunk@22567
e93f8b46-1217-0410-a6f0-
8f06a7374b81
all
else
view_all_active = false
- if user.memberships.to_a.any?
- view_all_active = user.memberships.any? {|m| m.roles.any? {|r| r.users_visibility == 'all'}}
+ if user.memberships.any?
+ view_all_active = User.where(id: user.id).joins(memberships: :roles).where("#{Role.table_name}.users_visibility = ?", 'all').any?
else
view_all_active = user.builtin_role.users_visibility == 'all'
end