Fix user roles for protocol access modal [SCI-10388] (#7275)

This commit is contained in:
Soufiane 2024-03-14 12:17:07 +00:00 committed by GitHub
parent 8165f46f3f
commit ce5c02d590
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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 %>"
/>

View file

@ -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