mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
Fix project_tree for non admin users [SCI-2478]
This commit is contained in:
parent
58d8414f92
commit
8de0e282e3
1 changed files with 2 additions and 2 deletions
|
@ -342,8 +342,8 @@ class User < ApplicationRecord
|
||||||
result = team.projects.includes(active_experiments: :active_my_modules)
|
result = team.projects.includes(active_experiments: :active_my_modules)
|
||||||
unless is_admin_of_team?(team)
|
unless is_admin_of_team?(team)
|
||||||
# Only admins see all projects of the team
|
# Only admins see all projects of the team
|
||||||
result = result.includes(:user_projects).where(
|
result = result.joins(:user_projects).where(
|
||||||
'visibility = 1 OR user_projects.user_id=:user_id)', user_id: id
|
'visibility=1 OR user_projects.user_id=:user_id', user_id: id
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue