This commit is contained in:
Owen
2025-09-07 10:46:44 -07:00
parent 5845ddbdda
commit 64722617c1

View File

@@ -19,6 +19,11 @@ export async function verifyApiKeySetResourceUsers(
);
}
if (apiKey.isRoot) {
// Root keys can access any key in any org
return next();
}
if (!req.apiKeyOrg) {
return next(
createHttpError(
@@ -32,11 +37,6 @@ export async function verifyApiKeySetResourceUsers(
return next(createHttpError(HttpCode.BAD_REQUEST, "Invalid user IDs"));
}
if (apiKey.isRoot) {
// Root keys can access any key in any org
return next();
}
if (userIds.length === 0) {
return next();
}