Commit 31d8356d authored by jan.koester's avatar jan.koester
Browse files

test

parent 35231074
Loading
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -1252,15 +1252,6 @@ namespace authdb {
            }
            json_object_object_add(jobj, "gpodefault", json_object_new_boolean(gpodat.getGpoValue()));

            // Allowed groups
            std::vector<uuid::uuid> allow;
            gpodat.getAlowed(allow);
            json_object *jallowed = json_object_new_array();
            for (const auto &a : allow) {
                json_object_array_add(jallowed, json_object_new_string(a.c_str()));
            }
            json_object_object_add(jobj, "allowed", jallowed);

            // All groups
            json_object *jallgroups = json_object_new_array();
            Group grplst;
@@ -1279,6 +1270,24 @@ namespace authdb {
            }
            json_object_object_add(jobj, "allgroups", jallgroups);

            // Allowed groups (filter out missing groups)
            std::vector<uuid::uuid> allow;
            gpodat.getAlowed(allow);
            json_object *jallowed = json_object_new_array();
            for (const auto &a : allow) {
                bool found = false;
                for (const auto &gid : grpids) {
                    if (a == gid) {
                        found = true;
                        break;
                    }
                }
                if (found) {
                    json_object_array_add(jallowed, json_object_new_string(a.c_str()));
                }
            }
            json_object_object_add(jobj, "allowed", jallowed);

            sendJson(curreq, jobj);
            json_object_put(jobj);
        }