Fix permission checks for protocols draft comment editing [SCI-11586] (#8264)

This commit is contained in:
Alex Kriuchykhin 2025-02-26 09:40:18 +01:00 committed by GitHub
parent 92c38b19e8
commit 50822ba883
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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