🔒 fix: Memory Disabled Config UI Permissions (2/2)

This commit is contained in:
Danny Avila 2025-09-09 22:00:01 -04:00
parent 5c0e9d8fbb
commit 1247207afe
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
2 changed files with 95 additions and 1 deletions

View file

@ -111,14 +111,20 @@ export async function updateInterfacePermissions({
const permTypeExists = existingPermissions?.[permType];
const isExplicitlyConfigured =
interfaceConfig && hasExplicitConfig(interfaceConfig, permType);
const isMemoryDisabled =
permType === PermissionTypes.MEMORIES && isMemoryExplicitlyDisabled === true;
// Only update if: doesn't exist OR explicitly configured
if (!permTypeExists || isExplicitlyConfigured) {
if (!permTypeExists || isExplicitlyConfigured || isMemoryDisabled) {
permissionsToUpdate[permType] = permissions;
if (!permTypeExists) {
logger.debug(`Role '${roleName}': Setting up default permissions for '${permType}'`);
} else if (isExplicitlyConfigured) {
logger.debug(`Role '${roleName}': Applying explicit config for '${permType}'`);
} else if (isMemoryDisabled) {
logger.debug(
`Role '${roleName}': Disabling memories as it is explicitly disabled in config`,
);
}
} else {
logger.debug(`Role '${roleName}': Preserving existing permissions for '${permType}'`);