mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-04-17 17:50:26 +08:00
Fixed viewable projects scope in reports controller [SCI-6200] (#3634)
This commit is contained in:
parent
ba5403ab5e
commit
e3d08db6de
1 changed files with 7 additions and 6 deletions
|
@ -354,12 +354,13 @@ class ReportsController < ApplicationController
|
|||
.where.not(original_repository: live_repositories)
|
||||
.select('DISTINCT ON ("repositories"."parent_id") "repositories".*')
|
||||
@repositories = (live_repositories + snapshots_of_deleted).sort_by { |r| r.name.downcase }
|
||||
@visible_projects = Project.active
|
||||
.viewable_by_user(current_user, current_team)
|
||||
.joins(experiments: :my_modules)
|
||||
.merge(Experiment.active)
|
||||
.merge(MyModule.active)
|
||||
.select(:id, :name)
|
||||
@visible_projects = current_team.projects
|
||||
.active
|
||||
.joins(experiments: :my_modules)
|
||||
.with_granted_permissions(current_user, ProjectPermissions::READ)
|
||||
.merge(Experiment.active)
|
||||
.merge(MyModule.active)
|
||||
.select(:id, :name)
|
||||
end
|
||||
|
||||
def check_manage_permissions
|
||||
|
|
Loading…
Add table
Reference in a new issue