Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(backend:users): clear whitelist caches when group visibility changes

johaven071c3aed68d3
diff --git a/backend/src/applications/users/services/admin-users-manager.service.ts b/backend/src/applications/users/services/admin-users-manager.service.ts
index 364f00d0..ef04eed9 100644
--- a/backend/src/applications/users/services/admin-users-manager.service.ts
+++ b/backend/src/applications/users/services/admin-users-manager.service.ts
@@ -259,6 +259,10 @@ export class AdminUsersManager {
if (!(await this.adminQueries.updateGroup(groupId, updateGroupDto))) {
throw new HttpException('Unable to update group', HttpStatus.INTERNAL_SERVER_ERROR)
}
+ // Clear whitelist caches when the group’s visibility is changed
+ if (updateGroupDto.visibility !== undefined) {
+ this.adminQueries.usersQueries.clearWhiteListCaches('*')
+ }
return this.adminQueries.groupFromId(groupId)
}