mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-03 02:14:29 +08:00
Change permissions for dashboard quick start modal [SCI-6338]
This commit is contained in:
parent
35179607b4
commit
3de3da9ecc
1 changed files with 5 additions and 3 deletions
|
@ -20,7 +20,7 @@ module Dashboard
|
|||
end
|
||||
|
||||
def project_filter
|
||||
projects = Project.managable_by_user(current_user)
|
||||
projects = Project.readable_by_user(current_user)
|
||||
.search(current_user, false, params[:query], 1, current_team)
|
||||
.select(:id, :name)
|
||||
projects = projects.map { |i| { value: i.id, label: escape_input(i.name) } }
|
||||
|
@ -39,7 +39,9 @@ module Dashboard
|
|||
.search(current_user, false, params[:query], 1, current_team)
|
||||
.select(:id, :name)
|
||||
experiments = experiments.map { |i| { value: i.id, label: escape_input(i.name) } }
|
||||
if (experiments.map { |i| i[:label] }.exclude? params[:query]) && params[:query].present?
|
||||
if (experiments.map { |i| i[:label] }.exclude? params[:query]) &&
|
||||
params[:query].present? &&
|
||||
can_create_project_experiments?(@project)
|
||||
experiments = [{ value: 0, label: params[:query] }] + experiments
|
||||
end
|
||||
end
|
||||
|
@ -57,7 +59,7 @@ module Dashboard
|
|||
end
|
||||
|
||||
def load_project
|
||||
@project = current_team.projects.managable_by_user(current_user).find_by(id: params.dig(:project, :id))
|
||||
@project = current_team.projects.readable_by_user(current_user).find_by(id: params.dig(:project, :id))
|
||||
end
|
||||
|
||||
def load_experiment
|
||||
|
|
Loading…
Add table
Reference in a new issue