mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-05 22:44:22 +08:00
fixes reports index for guest users
This commit is contained in:
parent
1f8db7bc49
commit
bbbe06e491
1 changed files with 4 additions and 5 deletions
|
@ -46,13 +46,12 @@ class Project < ApplicationRecord
|
|||
if user.is_admin_of_team? team
|
||||
return where('projects.archived IS FALSE AND projects.name ILIKE ?',
|
||||
"%#{name}%")
|
||||
elsif user.is_normal_user_of_team? team
|
||||
return joins(:user_projects)
|
||||
end
|
||||
joins(:user_projects)
|
||||
.where('user_projects.user_id = ? OR projects.visibility = 1', user.id)
|
||||
.where('projects.archived IS FALSE AND projects.name ILIKE ?',
|
||||
"%#{name}%")
|
||||
end
|
||||
end
|
||||
|
||||
def self.search(
|
||||
user,
|
||||
|
|
Loading…
Reference in a new issue