FEAT - LAUNCHER: expose system Codex agent entitlement
This commit is contained in:
+10
-2
@@ -2545,12 +2545,16 @@ function isPublicPoolUser(data, user) {
|
||||
|
||||
function resolveUserServiceModules(data, user, serviceSlug, clientId) {
|
||||
if (!user?.id) return {};
|
||||
const normalizedClientId = normalizeOptionalText(clientId);
|
||||
if (!normalizedClientId) return {};
|
||||
const service = data.services.find(
|
||||
(candidate) => candidate.slug === serviceSlug || candidate.authentikApplicationSlug === serviceSlug
|
||||
);
|
||||
if (!service?.id) return {};
|
||||
if (hasSystemServiceModuleEntitlement(user, service, "codex_agents")) {
|
||||
return { codex_agents: true };
|
||||
}
|
||||
|
||||
const normalizedClientId = normalizeOptionalText(clientId);
|
||||
if (!normalizedClientId) return {};
|
||||
|
||||
return Object.fromEntries(
|
||||
(data.serviceModuleEntitlements ?? [])
|
||||
@@ -2565,6 +2569,10 @@ function resolveUserServiceModules(data, user, serviceSlug, clientId) {
|
||||
);
|
||||
}
|
||||
|
||||
function hasSystemServiceModuleEntitlement(user, service, moduleId) {
|
||||
return user?.id === "user_root" && moduleId === "codex_agents" && service?.slug === "task-manager";
|
||||
}
|
||||
|
||||
function getFrontchannelLogoutUrls() {
|
||||
const urls = [config.taskLogoutUrl];
|
||||
const launcherData = readLauncherData();
|
||||
|
||||
Reference in New Issue
Block a user