mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 07:34:41 +08:00
Fix user roles for protocol access modal [SCI-10388] (#7275)
This commit is contained in:
parent
8165f46f3f
commit
ce5c02d590
3 changed files with 7 additions and 1 deletions
|
@ -7,6 +7,7 @@ class ProtocolsController < ApplicationController
|
|||
include ProtocolsIoHelper
|
||||
include TeamsHelper
|
||||
include ProtocolsExporterV2
|
||||
include UserRolesHelper
|
||||
|
||||
before_action :check_create_permissions, only: %i(
|
||||
create
|
||||
|
@ -849,6 +850,10 @@ class ProtocolsController < ApplicationController
|
|||
render json: { job_id: @job.job_id }
|
||||
end
|
||||
|
||||
def user_roles
|
||||
render json: { data: user_roles_collection(Protocol.new).map(&:reverse) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_importer
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
:archived-page-url="'<%= protocols_path(view_mode: :archived) %>'"
|
||||
current-view-mode="<%= params[:view_mode] || :active %>"
|
||||
:docx-parser-enabled="<%= Protocol.docx_parser_enabled? %>"
|
||||
user-roles-url="<%= user_roles_projects_path %>"
|
||||
user-roles-url="<%= user_roles_protocols_path %>"
|
||||
:create-url="'<%= protocols_path if can_create_protocols_in_repository?(current_team) %>'"
|
||||
users-filter-url="<%= users_filter_projects_path %>"
|
||||
/>
|
||||
|
|
|
@ -667,6 +667,7 @@ Rails.application.routes.draw do
|
|||
get 'export', to: 'protocols#export'
|
||||
get 'protocolsio', to: 'protocols#protocolsio_index'
|
||||
get 'actions_toolbar', to: 'protocols#actions_toolbar'
|
||||
get 'user_roles', to: 'protocols#user_roles'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue