mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-15 09:34:29 +08:00
Fix permission checks for protocols draft comment editing [SCI-11586] (#8264)
This commit is contained in:
parent
92c38b19e8
commit
50822ba883
1 changed files with 2 additions and 8 deletions
|
@ -29,14 +29,8 @@ class ProtocolDraftSerializer < ActiveModel::Serializer
|
|||
}
|
||||
|
||||
urls_list[:publish] = publish_protocol_path(object) if can_publish_protocol_in_repository?(current_user, object)
|
||||
if can_delete_protocol_draft_in_repository?(current_user, object)
|
||||
urls_list[:destroy] = destroy_draft_protocol_path(object)
|
||||
end
|
||||
|
||||
if can_manage_protocol_draft_in_repository?(current_user, object) &&
|
||||
can_publish_protocol_in_repository?(current_user, object)
|
||||
urls_list[:comment] = update_version_comment_protocol_path(object)
|
||||
end
|
||||
urls_list[:destroy] = destroy_draft_protocol_path(object) if can_delete_protocol_draft_in_repository?(current_user, object)
|
||||
urls_list[:comment] = update_version_comment_protocol_path(object) if can_manage_protocol_draft_in_repository?(current_user, object)
|
||||
|
||||
urls_list
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue