File tree 1 file changed +12
-0
lines changed
classes/components/forms/submission
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 23
23
use PKP \components \forms \FormComponent ;
24
24
use PKP \config \Config ;
25
25
use PKP \context \Context ;
26
+ use PKP \facades \Repo ;
26
27
use PKP \security \Role ;
27
28
use PKP \userGroup \UserGroup ;
28
29
@@ -152,6 +153,17 @@ protected function addSubmissionChecklist(Context $context): void
152
153
*/
153
154
protected function addUserGroups (Enumerable $ userGroups ): void
154
155
{
156
+ $ groupsWithAccessToSubmissionStage = Repo::userGroup ()->getUserGroupsByStage ($ this ->context ->getId (), WORKFLOW_STAGE_ID_SUBMISSION )
157
+ ->pluck ('user_group_id ' )
158
+ ->toArray ();
159
+
160
+ // There isn't a submission stage in OPS, so $groupsWithAccessToSubmissionStage will be empty there.
161
+ // For other apps, filter $userGroups to be only those with access to submission stage
162
+ if (!empty ($ groupsWithAccessToSubmissionStage )) {
163
+ $ userGroups = $ userGroups ->filter (function (UserGroup $ userGroup ) use ($ groupsWithAccessToSubmissionStage ) {
164
+ return in_array ($ userGroup ->id , $ groupsWithAccessToSubmissionStage );
165
+ });
166
+ }
155
167
if ($ userGroups ->count () < 2 ) {
156
168
return ;
157
169
}
You can’t perform that action at this time.
0 commit comments