mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #4623 from okriuchykhin/ok_SCI_7447
Implement current team switch when navigating to tasks and experiments from another team [SCI-7447]
This commit is contained in:
commit
2314405f60
2 changed files with 2 additions and 7 deletions
|
@ -342,6 +342,7 @@ class ExperimentsController < ApplicationController
|
|||
end
|
||||
|
||||
def check_read_permissions
|
||||
current_team_switch(@experiment.project.team) if current_team != @experiment.project.team
|
||||
render_403 unless can_read_experiment?(@experiment) ||
|
||||
@experiment.archived? && can_read_archived_experiment?(@experiment)
|
||||
end
|
||||
|
|
|
@ -268,7 +268,6 @@ class MyModulesController < ApplicationController
|
|||
def protocols
|
||||
@protocol = @my_module.protocol
|
||||
@assigned_repositories = @my_module.live_and_snapshot_repositories_list
|
||||
current_team_switch(@protocol.team)
|
||||
end
|
||||
|
||||
def protocol
|
||||
|
@ -291,11 +290,6 @@ class MyModulesController < ApplicationController
|
|||
end
|
||||
|
||||
def results
|
||||
current_team_switch(@my_module
|
||||
.experiment
|
||||
.project
|
||||
.team)
|
||||
|
||||
@results_order = params[:order] || 'new'
|
||||
|
||||
@results = @my_module.archived_branch? ? @my_module.results : @my_module.results.active
|
||||
|
@ -311,7 +305,6 @@ class MyModulesController < ApplicationController
|
|||
|
||||
def archive
|
||||
@archived_results = @my_module.archived_results
|
||||
current_team_switch(@my_module.experiment.project.team)
|
||||
end
|
||||
|
||||
def restore_group
|
||||
|
@ -383,6 +376,7 @@ class MyModulesController < ApplicationController
|
|||
end
|
||||
|
||||
def check_read_permissions
|
||||
current_team_switch(@project.team) if current_team != @project.team
|
||||
render_403 unless can_read_my_module?(@my_module)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue