diff --git a/crates/directory/src/core/principal.rs b/crates/directory/src/core/principal.rs index d1e5ea71..a3d75f6e 100644 --- a/crates/directory/src/core/principal.rs +++ b/crates/directory/src/core/principal.rs @@ -912,7 +912,7 @@ impl Type { 1 => Type::Group, 2 => Type::Resource, 3 => Type::Location, - 4 => Type::Individual, // legacy + 4 => Type::Other, // legacy 5 => Type::List, 6 => Type::Other, 7 => Type::Domain, diff --git a/crates/http/src/management/principal.rs b/crates/http/src/management/principal.rs index be2f3d5e..eae36e3d 100644 --- a/crates/http/src/management/principal.rs +++ b/crates/http/src/management/principal.rs @@ -572,6 +572,7 @@ impl PrincipalManager for Server { })?; // Validate changes + let mut invalidate_logo_cache = false; for change in &changes { match change.field { PrincipalField::Secrets @@ -581,13 +582,16 @@ impl PrincipalManager for Server { | PrincipalField::UsedQuota | PrincipalField::Description | PrincipalField::Type - | PrincipalField::Picture | PrincipalField::MemberOf | PrincipalField::Members | PrincipalField::Lists | PrincipalField::Urls | PrincipalField::ExternalMembers | PrincipalField::Locale => (), + PrincipalField::Picture => { + invalidate_logo_cache |= + matches!(typ, Type::Domain | Type::Tenant); + } PrincipalField::Tenant => { // Tenants are not allowed to change their tenantId if access_token.tenant.is_some() { @@ -671,6 +675,11 @@ impl PrincipalManager for Server { // Increment revision self.invalidate_principal_caches(changed_principals).await; + // Invalidate logo cache if needed + if invalidate_logo_cache { + self.inner.data.logos.lock().clear(); + } + Ok(JsonResponse::new(json!({ "data": (), }))