use of ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.GlobalGroupType in project X-Road by nordic-institute.
the class GlobalConfImpl method isSubjectInGlobalGroup.
@Override
public boolean isSubjectInGlobalGroup(ClientId subjectId, GlobalGroupId groupId) {
SharedParametersV2 p;
try {
p = confDir.getShared(groupId.getXRoadInstance());
} catch (Exception e) {
p = null;
log.warn("Got exception while getting shared parameters.", e);
}
if (p == null) {
return false;
}
GlobalGroupType group = p.findGlobalGroup(groupId);
if (group == null) {
return false;
}
return group.getGroupMember().stream().filter(m -> m.equals(subjectId)).findFirst().isPresent();
}
Aggregations