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

Fixed minor issue in search endpoint

parent e812c2c9
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@ export default {
    onUpdate: Function,
    paginatorInput: Object
  },
  /*computed: mapState({
    input: state => state.input
  }),*/
  data: function() {
    return {
      pageSizeOptions: [{
+14 −12
Original line number Diff line number Diff line
@@ -79,23 +79,25 @@ public class JWTWebServiceController {

        List<String> groupNames = extractGroupNames(group);

        boolean isMemeber = false;
        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();
                isMemeber = membershipsDAO.isMemberOf(userId, groupEntity.getId());
                if (isMemeber) {
                    isMember = membershipsDAO.isMemberOf(userId, groupEntity.getId());
                    if (isMember) {
                        break;
                    }
                } else {
                    break;
                }
            }
        }

        if (isMemeber) {
        if (isMember) {
            try (PrintWriter pw = new PrintWriter(response.getOutputStream())) {
                pw.println(group);
            }