@@ -664,8 +664,34 @@ public function add(Request $illuminateRequest): JsonResponse
664
664
: $ submitAsUserGroup ->permitMetadataEdit
665
665
);
666
666
667
+ $ isSubmittingAsProductionEditor = $ submitAsUserGroup ->getLocalizedData ('name ' ) === __ ('default.groups.name.productionEditor ' );
668
+ // Temporary solution for https://github.com/pkp/pkp-lib/issues/10929
669
+ // If submitting as Production Editor, then also assign as Author to allow full access to submission stage
670
+ if ($ isSubmittingAsProductionEditor ) {
671
+ $ authorGroup = Repo::userGroup ()->getByRoleIds ([Role::ROLE_ID_AUTHOR ], $ context ->getId ())->first ();
672
+
673
+ // Assign author role to user if not already assigned
674
+ if (!$ submitterUserGroups ->contains ('roleId ' , Role::ROLE_ID_AUTHOR )) {
675
+ Repo::userGroup ()->assignUserToGroup (
676
+ $ user ->getId (),
677
+ $ authorGroup ->id
678
+ );
679
+ }
680
+
681
+ // Assign Production Editor to submission as an Author to allow access to submission stage operations
682
+ Repo::stageAssignment ()
683
+ ->build (
684
+ $ submission ->getId (),
685
+ $ authorGroup ->id ,
686
+ $ request ->getUser ()->getId (),
687
+ $ authorGroup ->recommendOnly ,
688
+ // Authors can always edit metadata before submitting
689
+ true
690
+ );
691
+ }
692
+
667
693
// Create an author record from the submitter's user account
668
- if ($ submitAsUserGroup ->roleId === Role::ROLE_ID_AUTHOR ) {
694
+ if ($ submitAsUserGroup ->roleId === Role::ROLE_ID_AUTHOR || $ isSubmittingAsProductionEditor ) {
669
695
$ author = Repo::author ()->newAuthorFromUser ($ request ->getUser (), $ submission , $ context );
670
696
$ author ->setData ('publicationId ' , $ publication ->getId ());
671
697
$ author ->setUserGroupId ($ submitAsUserGroup ->id );
0 commit comments