mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 03:59:51 +08:00
Merge pull request #5180 from okriuchykhin/ok_SCI_8174
Fix create step comments permissions [SCI-8174]
This commit is contained in:
commit
b29d4724a2
3 changed files with 5 additions and 5 deletions
|
@ -102,9 +102,9 @@ class CommentsController < ApplicationController
|
|||
when MyModule
|
||||
render_403 and return unless can_create_my_module_comments?(@commentable)
|
||||
when Step
|
||||
render_403 and return unless can_create_my_module_comments?(@commentable.protocol.my_module)
|
||||
render_403 and return unless can_create_comments_in_my_module_steps?(@commentable.protocol.my_module)
|
||||
when Result
|
||||
render_403 and return unless can_create_my_module_comments?(@commentable.my_module)
|
||||
render_403 and return unless can_create_my_module_result_comments?(@commentable.my_module)
|
||||
else
|
||||
render_403 and return
|
||||
end
|
||||
|
|
|
@ -62,9 +62,9 @@ module CommentHelper
|
|||
when 'MyModule'
|
||||
can_create_my_module_comments?(object)
|
||||
when 'Step'
|
||||
can_create_my_module_comments?(object.my_module)
|
||||
can_create_comments_in_my_module_steps?(object.my_module)
|
||||
when 'Result'
|
||||
can_create_my_module_comments?(object.my_module)
|
||||
can_create_my_module_result_comments?(object.my_module)
|
||||
when 'Project'
|
||||
can_create_project_comments?(object)
|
||||
else
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= render partial: 'shared/comments/comments.html.erb', locals: {
|
||||
object: step,
|
||||
comments: comments,
|
||||
can_create_comments: can_create_my_module_comments?(@protocol.my_module),
|
||||
can_create_comments: can_create_comments_in_my_module_steps?(@protocol.my_module),
|
||||
create_url: step_step_comments_path(step, format: :json),
|
||||
more_url: step_step_comments_path(step, format: :json, from: comments.first&.id)
|
||||
} %>
|
||||
|
|
Loading…
Reference in a new issue