mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 16:45:18 +08:00
Fix the failing test: repository row should be in correct repository
This commit is contained in:
parent
3a8fc01ff7
commit
04c294adb1
1 changed files with 3 additions and 4 deletions
|
@ -53,10 +53,9 @@ class RepositoryRowsController < ApplicationController
|
|||
def show
|
||||
@repository_row = RepositoryRow.find_by(id: params[:id])
|
||||
render_403 unless can_read_repository?(@repository_row.repository)
|
||||
|
||||
row = RepositoryRow.find_by(id: @repository_row.parent_id) if @repository_row.parent_id
|
||||
row ||= @repository_row
|
||||
@assigned_modules = row.my_modules.joins(experiment: :project)
|
||||
render_403 unless @repository_row.repository_id == params[:repository_id]
|
||||
|
||||
@assigned_modules = @repository_row.my_modules.joins(experiment: :project)
|
||||
@viewable_modules = @assigned_modules.viewable_by_user(current_user, current_user.teams)
|
||||
@private_modules = @assigned_modules - @viewable_modules
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue