Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit 733597a

Browse files
author
Dominik Frantisek Bucik
committed
fix: 🐛 Added missing return values when RPC disabled
1 parent e1f5cd2 commit 733597a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

perun-oidc-server/src/main/java/cz/muni/ics/oidc/server/adapters/impl/PerunAdapterRpc.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,11 @@ public Set<Long> getUserGroupsIds(Long userId, Long voId) {
851851

852852
@Override
853853
public boolean isValidMemberInGroupsAndVos(Long userId, Set<Long> mandatoryVos, Set<Long> mandatoryGroups,
854-
Set<Long> envVos, Set<Long> envGroups) {
854+
Set<Long> envVos, Set<Long> envGroups)
855+
{
856+
if (!this.connectorRpc.isEnabled()) {
857+
return false;
858+
}
855859
List<Member> members = getMembersByUser(userId);
856860
Set<Long> foundVoIds = new HashSet<>();
857861
Set<Long> foundGroupIds = new HashSet<>();
@@ -869,7 +873,11 @@ public boolean isValidMemberInGroupsAndVos(Long userId, Set<Long> mandatoryVos,
869873
}
870874

871875
@Override
872-
public boolean isValidMemberInGroupsAndVos(Long userId, Set<Long> vos, Set<Long> groups) {
876+
public boolean isValidMemberInGroupsAndVos(Long userId, Set<Long> vos, Set<Long> groups)
877+
{
878+
if (!this.connectorRpc.isEnabled()) {
879+
return false;
880+
}
873881
List<Member> members = getMembersByUser(userId);
874882
Set<Long> foundVoIds = new HashSet<>();
875883
Set<Long> foundGroupIds = new HashSet<>();
@@ -889,6 +897,9 @@ public boolean isValidMemberInGroupsAndVos(Long userId, Set<Long> vos, Set<Long>
889897

890898
@Override
891899
public boolean isUserInVo(Long userId, String voShortName) {
900+
if (!this.connectorRpc.isEnabled()) {
901+
return false;
902+
}
892903
if (userId == null) {
893904
throw new IllegalArgumentException("No userId");
894905
} else if (!StringUtils.hasText(voShortName)) {

0 commit comments

Comments
 (0)