diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_action/delete.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_action/delete.coffee index 5097b4d4f..64af8cd01 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_action/delete.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_action/delete.coffee @@ -43,7 +43,7 @@ class Delete @deletableForAgent: (actions, ticket, article, ui) -> return false if ticket.currentView() is 'customer' return false if article.created_by_id != App.User.current()?.id - return false if article.type.communication + return false if article.type.communication && !article.internal true diff --git a/app/policies/ticket/article_policy.rb b/app/policies/ticket/article_policy.rb index e01c85a36..5de7f6788 100644 --- a/app/policies/ticket/article_policy.rb +++ b/app/policies/ticket/article_policy.rb @@ -29,7 +29,7 @@ class Ticket::ArticlePolicy < ApplicationPolicy return not_authorized('you can only delete your own notes') end - if record.type.communication? + if record.type.communication? && !record.internal? return not_authorized('communication articles cannot be deleted') end diff --git a/spec/requests/ticket/article_spec.rb b/spec/requests/ticket/article_spec.rb index 8f98c4552..c9b6a113a 100644 --- a/spec/requests/ticket/article_spec.rb +++ b/spec/requests/ticket/article_spec.rb @@ -592,7 +592,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO include_examples 'deleting', item: 'article_note_communication_self', - now: false, later: false, much_later: false + now: true, later: true, much_later: false include_examples 'deleting', item: 'article_note_communication_other', @@ -620,7 +620,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO include_examples 'deleting', item: 'article_note_communication_self', - now: false, later: false, much_later: false + now: true, later: true, much_later: false include_examples 'deleting', item: 'article_note_communication_other', diff --git a/spec/system/ticket/zoom_spec.rb b/spec/system/ticket/zoom_spec.rb index c516de33c..d36072304 100644 --- a/spec/system/ticket/zoom_spec.rb +++ b/spec/system/ticket/zoom_spec.rb @@ -368,7 +368,7 @@ RSpec.describe 'Ticket zoom', type: :system do include_examples 'deleting ticket article', item: 'article_note_communication_self', - now: false, later: false, much_later: false + now: true, later: true, much_later: false include_examples 'deleting ticket article', item: 'article_note_communication_other', @@ -396,7 +396,7 @@ RSpec.describe 'Ticket zoom', type: :system do include_examples 'deleting ticket article', item: 'article_note_communication_self', - now: false, later: false, much_later: false + now: true, later: true, much_later: false include_examples 'deleting ticket article', item: 'article_note_communication_other',