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
|
if user.is_admin_of_team? team
|
||||||
return where('projects.archived IS FALSE AND projects.name ILIKE ?',
|
return where('projects.archived IS FALSE AND projects.name ILIKE ?',
|
||||||
"%#{name}%")
|
"%#{name}%")
|
||||||
elsif user.is_normal_user_of_team? team
|
end
|
||||||
return joins(:user_projects)
|
joins(:user_projects)
|
||||||
.where('user_projects.user_id = ? OR projects.visibility = 1', user.id)
|
.where('user_projects.user_id = ? OR projects.visibility = 1', user.id)
|
||||||
.where('projects.archived IS FALSE AND projects.name ILIKE ?',
|
.where('projects.archived IS FALSE AND projects.name ILIKE ?',
|
||||||
"%#{name}%")
|
"%#{name}%")
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def self.search(
|
def self.search(
|
||||||
user,
|
user,
|
||||||
|
|
Loading…
Reference in a new issue