Commit c20437ad authored by jan.koester's avatar jan.koester
Browse files

test

parent 7014bd1a
Loading
Loading
Loading
Loading
Loading
+7 −2
Changes for src/admin.cpp: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -503,7 +503,11 @@ namespace authdb {
            // Refresh admin backend data from cluster (RAII: lock + unlock)
            AuthBackendLock guard(_AdminBackend);

            // Find "SuperAdmin" group in admin backend and check membership
            // Get the user ID from the session
            uuid::uuid uid;
            sdat->getUid(uid);

            // Find "SuperAdmin" group in admin backend and check membership directly
            Group group;
            size_t rd = sizeof(authdb::AuthHeader), end = _AdminBackend.end();
            while (rd < end) {
@@ -519,7 +523,8 @@ namespace authdb {
                        size_t gpos = sizeof(authdb::AuthHeader);
                        group.info(_AdminBackend, gdat, gpos);
                        if (gdat.getName() == "SuperAdmin") {
                            return sdat->isMemberOf(uuid::uuid(cur->ruid));
                            // Check membership from backend data, not session cache
                            return gdat.isMember(uid);
                        }
                    } catch (AuthBackendError &e) {
                        std::cerr << e.what() << std::endl;