diff --git a/classes/security/authorization/internal/SubmissionCompletePolicy.inc.php b/classes/security/authorization/internal/SubmissionCompletePolicy.inc.php new file mode 100644 index 00000000000..19084fa05ee --- /dev/null +++ b/classes/security/authorization/internal/SubmissionCompletePolicy.inc.php @@ -0,0 +1,60 @@ +getDataObjectId(); + + $submissionDao = DAORegistry::getDAO("SubmissionDAO"); /** @var SubmissionDAO $submissionDao */ + $submission = $submissionDao->getById($submissionId); + + if ($submission->getData('submissionProgress') > 0) { + return AUTHORIZATION_DENY; + } + + return AUTHORIZATION_PERMIT; + } +} diff --git a/locale/en_US/user.po b/locale/en_US/user.po index 9491815994b..b7e80911c9c 100644 --- a/locale/en_US/user.po +++ b/locale/en_US/user.po @@ -66,6 +66,9 @@ msgstr "You don't currently have access to that stage of the workflow." msgid "user.authorization.workflowStageRequired" msgstr "A workflow stage was not specified." +msgid "user.authorization.submission.incomplete.workflowAccessRestrict" +msgstr "Workflow access for incomplete submission is restricted." + msgid "user.authorization.pluginRequired" msgstr "A plugin was not specified and is required." diff --git a/pages/workflow/PKPWorkflowHandler.inc.php b/pages/workflow/PKPWorkflowHandler.inc.php index 14152fc1aaa..526a675af6a 100644 --- a/pages/workflow/PKPWorkflowHandler.inc.php +++ b/pages/workflow/PKPWorkflowHandler.inc.php @@ -49,6 +49,9 @@ function authorize($request, &$args, $roleAssignments) { $this->markRoleAssignmentsChecked(); } else { + import('lib.pkp.classes.security.authorization.internal.SubmissionCompletePolicy'); + $this->addPolicy(new SubmissionCompletePolicy($request, $args, 'submissionId')); + import('lib.pkp.classes.security.authorization.WorkflowStageAccessPolicy'); $this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', $this->identifyStageId($request, $args), WORKFLOW_TYPE_EDITORIAL)); }