From d71ba3194f6f58b49a5b9e1e2cc6a87899d8f508 Mon Sep 17 00:00:00 2001 From: Brandon Straley Date: Tue, 8 Nov 2016 16:10:48 -0800 Subject: [PATCH 1/2] Change subject.agent to subject.user --- app/forms/curation_concerns/forms/workflow_action_form.rb | 2 +- .../curation_concerns/workflow/workflow_action_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/forms/curation_concerns/forms/workflow_action_form.rb b/app/forms/curation_concerns/forms/workflow_action_form.rb index ab74cdee2..f30838b4e 100644 --- a/app/forms/curation_concerns/forms/workflow_action_form.rb +++ b/app/forms/curation_concerns/forms/workflow_action_form.rb @@ -39,7 +39,7 @@ def save def authorized_for_processing return true if CurationConcerns::Workflow::PermissionQuery.authorized_for_processing?( - user: subject.agent, + user: subject.user, entity: subject.entity, action: sipity_workflow_action ) diff --git a/app/services/curation_concerns/workflow/workflow_action_service.rb b/app/services/curation_concerns/workflow/workflow_action_service.rb index 6bf5620dd..f03b03237 100644 --- a/app/services/curation_concerns/workflow/workflow_action_service.rb +++ b/app/services/curation_concerns/workflow/workflow_action_service.rb @@ -30,7 +30,7 @@ def update_sipity_workflow_state def create_sipity_comment return true unless comment_text.present? - Sipity::Comment.create!(entity: subject.entity, agent: subject.agent, comment: comment_text) + Sipity::Comment.create!(entity: subject.entity, agent: subject.user, comment: comment_text) end def handle_sipity_notifications(comment:) From 8bbbaa88ee3dbb82f133b53897a95a621966895b Mon Sep 17 00:00:00 2001 From: Brandon Straley Date: Wed, 9 Nov 2016 08:35:34 -0800 Subject: [PATCH 2/2] Re-adds in one 'subject.agent' --- .../curation_concerns/workflow/workflow_action_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/curation_concerns/workflow/workflow_action_service.rb b/app/services/curation_concerns/workflow/workflow_action_service.rb index f03b03237..6bf5620dd 100644 --- a/app/services/curation_concerns/workflow/workflow_action_service.rb +++ b/app/services/curation_concerns/workflow/workflow_action_service.rb @@ -30,7 +30,7 @@ def update_sipity_workflow_state def create_sipity_comment return true unless comment_text.present? - Sipity::Comment.create!(entity: subject.entity, agent: subject.user, comment: comment_text) + Sipity::Comment.create!(entity: subject.entity, agent: subject.agent, comment: comment_text) end def handle_sipity_notifications(comment:)