Skip to content
Snippets Groups Projects
Commit f0ea301c authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Fixed minor issue in search endpoint

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