Skip to content

Commit d7d4d05

Browse files
committed
fix: Review permissions - EXO-79156
This change will review the process permissions depending on users roles.
1 parent 784a1de commit d7d4d05

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

processes-services/src/main/java/org/exoplatform/processes/Utils/ProcessesUtils.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package org.exoplatform.processes.Utils;
22

3-
import java.util.ArrayList;
4-
import java.util.HashSet;
5-
import java.util.List;
6-
import java.util.Set;
3+
import java.util.*;
74

85
import org.exoplatform.commons.utils.CommonsUtils;
96
import org.exoplatform.portal.config.UserACL;
@@ -60,7 +57,7 @@ public static boolean isProcessAdmin(org.exoplatform.services.security.Identity
6057

6158
public static boolean isProcessManager(org.exoplatform.services.security.Identity identity, WorkFlow workFlow) {
6259
UserACL userAcl = CommonsUtils.getService(UserACL.class);
63-
return userAcl.isMemberOf(identity, getProjectParentSpace(workFlow.getProjectId()).getGroupId());
60+
return userAcl.isMemberOf(identity, Objects.requireNonNull(getProjectParentSpace(workFlow.getProjectId())).getGroupId());
6461
}
6562

6663
public static boolean isProcessParticipant(org.exoplatform.services.security.Identity identity, WorkFlow workFlow) {
@@ -70,7 +67,7 @@ public static boolean isProcessParticipant(org.exoplatform.services.security.Ide
7067

7168
public static Set<String> getGroupsFromRequestCreators(List<CreatorIdentityEntity> requestsCreators) {
7269
SpaceService spaceService = CommonsUtils.getService(SpaceService.class);
73-
List<String> groups = new ArrayList();
70+
List<String> groups = new ArrayList<>();
7471
for (CreatorIdentityEntity id : requestsCreators) {
7572
if (id.getIdentity().getProviderId().equals("space")) {
7673
Space space = spaceService.getSpaceByPrettyName(id.getIdentity().getRemoteId());

0 commit comments

Comments
 (0)