Commit f0ea301c authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Fixed minor issue in search endpoint

parent e812c2c9
......@@ -29,9 +29,6 @@ export default {
onUpdate: Function,
paginatorInput: Object
},
/*computed: mapState({
input: state => state.input
}),*/
data: function() {
return {
pageSizeOptions: [{
......
......@@ -79,23 +79,25 @@ public class JWTWebServiceController {
List<String> groupNames = extractGroupNames(group);
boolean isMemeber = false;
String parentPath = ""; // starting from ROOT
for (String groupName : groupNames) {
Optional<GroupEntity> optionalGroup = groupsDAO.findGroupByParentAndName(parentPath, groupName);
if (optionalGroup.isPresent()) {
GroupEntity groupEntity = optionalGroup.get();
parentPath = groupEntity.getPath();
isMemeber = membershipsDAO.isMemberOf(userId, groupEntity.getId());
if (isMemeber) {
boolean isMember = membershipsDAO.isMemberOf(userId, "ROOT");
if (!isMember) {
String parentPath = ""; // starting from ROOT
for (String groupName : groupNames) {
Optional<GroupEntity> optionalGroup = groupsDAO.findGroupByParentAndName(parentPath, groupName);
if (optionalGroup.isPresent()) {
GroupEntity groupEntity = optionalGroup.get();
parentPath = groupEntity.getPath();
isMember = membershipsDAO.isMemberOf(userId, groupEntity.getId());
if (isMember) {
break;
}
} else {
break;
}
} else {
break;
}
}
if (isMemeber) {
if (isMember) {
try (PrintWriter pw = new PrintWriter(response.getOutputStream())) {
pw.println(group);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment