mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-03 18:35:36 +08:00
Merge pull request #7963 from artoscinote/ma_SCI_11181
Further fix team viewer location permissions [SCI-11181]
This commit is contained in:
commit
b0f41eb14b
5 changed files with 18 additions and 13 deletions
|
@ -6,7 +6,7 @@ class StorageLocationRepositoryRowsController < ApplicationController
|
|||
before_action :load_storage_location
|
||||
before_action :load_repository_row, only: %i(create update destroy move)
|
||||
before_action :check_read_permissions, except: %i(create actions_toolbar)
|
||||
before_action :check_manage_permissions, only: %i(create update destroy)
|
||||
before_action :check_manage_permissions, only: %i(create update destroy move)
|
||||
|
||||
def index
|
||||
storage_location_repository_row = Lists::StorageLocationRepositoryRowsService.new(
|
||||
|
@ -134,7 +134,7 @@ class StorageLocationRepositoryRowsController < ApplicationController
|
|||
end
|
||||
|
||||
def check_manage_permissions
|
||||
render_403 unless can_create_storage_location_repository_rows?(@storage_location)
|
||||
render_403 unless can_manage_storage_location_repository_rows?(@storage_location)
|
||||
end
|
||||
|
||||
def log_activity(type_of, message_items = {})
|
||||
|
|
|
@ -10,6 +10,7 @@ class StorageLocationsController < ApplicationController
|
|||
before_action :check_storage_locations_enabled, except: :unassign_rows
|
||||
before_action :load_storage_location, only: %i(update destroy duplicate move show available_positions unassign_rows export_container import_container)
|
||||
before_action :check_read_permissions, except: %i(index create tree actions_toolbar import_container unassign_rows)
|
||||
before_action :check_manage_repository_rows_permissions, only: %i(import_container unassign_rows)
|
||||
before_action :check_create_permissions, only: :create
|
||||
before_action :check_manage_permissions, only: %i(update destroy duplicate move)
|
||||
before_action :set_breadcrumbs_items, only: %i(index show)
|
||||
|
@ -230,6 +231,10 @@ class StorageLocationsController < ApplicationController
|
|||
render_403 unless can_manage_storage_location?(@storage_location)
|
||||
end
|
||||
|
||||
def check_manage_repository_rows_permissions
|
||||
render_403 unless can_manage_storage_location_repository_rows?(@storage_location)
|
||||
end
|
||||
|
||||
def set_breadcrumbs_items
|
||||
@breadcrumbs_items = []
|
||||
|
||||
|
|
|
@ -181,15 +181,15 @@ export default {
|
|||
type: 'emit',
|
||||
buttonStyle: 'btn btn-primary'
|
||||
});
|
||||
}
|
||||
|
||||
left.push({
|
||||
name: 'import',
|
||||
icon: 'sn-icon sn-icon-import',
|
||||
label: this.i18n.t('storage_locations.show.import_modal.import_button'),
|
||||
type: 'emit',
|
||||
buttonStyle: 'btn btn-light'
|
||||
});
|
||||
left.push({
|
||||
name: 'import',
|
||||
icon: 'sn-icon sn-icon-import',
|
||||
label: this.i18n.t('storage_locations.show.import_modal.import_button'),
|
||||
type: 'emit',
|
||||
buttonStyle: 'btn btn-light'
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
left,
|
||||
|
|
|
@ -27,7 +27,7 @@ module Toolbars
|
|||
private
|
||||
|
||||
def unassign_action
|
||||
return unless can_read_storage_location?(@storage_location)
|
||||
return unless can_manage_storage_location_repository_rows?(@storage_location)
|
||||
|
||||
{
|
||||
name: 'unassign',
|
||||
|
@ -39,7 +39,7 @@ module Toolbars
|
|||
end
|
||||
|
||||
def move_action
|
||||
return unless @single && can_read_storage_location?(@storage_location)
|
||||
return unless @single && can_manage_storage_location_repository_rows?(@storage_location)
|
||||
|
||||
{
|
||||
name: 'move',
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
ref="container"
|
||||
actions-url="<%= actions_toolbar_storage_location_storage_location_repository_rows_path(@storage_location) %>"
|
||||
data-source="<%= storage_location_storage_location_repository_rows_path(@storage_location) %>"
|
||||
:can-manage="<%= can_create_storage_location_repository_rows?(@storage_location) %>"
|
||||
:can-manage="<%= can_manage_storage_location_repository_rows?(@storage_location) %>"
|
||||
:with-grid="<%= @storage_location.with_grid? %>"
|
||||
:grid-size="<%= @storage_location.grid_size.to_json %>"
|
||||
:container-id="<%= @storage_location.id %>"
|
||||
|
|
Loading…
Add table
Reference in a new issue