mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-02 21:51:51 +08:00
Merge pull request #2772 from mlorb/ml-sci-4907
Fix inventory card view for snapshots as default view [SCI-4907]
This commit is contained in:
commit
02bb29cf79
1 changed files with 8 additions and 3 deletions
|
@ -4,9 +4,9 @@ class RepositoryRowsController < ApplicationController
|
|||
include ApplicationHelper
|
||||
include MyModulesHelper
|
||||
|
||||
before_action :load_repository
|
||||
before_action :load_repository_row, only: %i(update show assigned_task_list)
|
||||
before_action :check_read_permissions, except: %i(create update delete_records copy_records)
|
||||
before_action :load_repository, except: :show
|
||||
before_action :load_repository_row, only: %i(update assigned_task_list)
|
||||
before_action :check_read_permissions, except: %i(show create update delete_records copy_records)
|
||||
before_action :check_snapshotting_status, only: %i(create update delete_records copy_records)
|
||||
before_action :check_create_permissions, only: :create
|
||||
before_action :check_delete_permissions, only: %i(delete_records archive_records restore_records)
|
||||
|
@ -51,6 +51,11 @@ class RepositoryRowsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@repository_row = RepositoryRow.find_by(id: params[:id])
|
||||
return render_404 unless @repository_row
|
||||
return render_404 unless @repository_row.repository_id == params[:repository_id].to_i
|
||||
return render_403 unless can_read_repository?(@repository_row.repository)
|
||||
|
||||
@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…
Reference in a new issue