mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-18 16:55:24 +00:00
Notify groups only when enabled
This commit is contained in:
parent
96f9d1858c
commit
c09db88f4e
1 changed files with 10 additions and 7 deletions
|
@ -273,15 +273,18 @@ impl Cipher {
|
||||||
None => {
|
None => {
|
||||||
// Belongs to Organization, need to update affected users
|
// Belongs to Organization, need to update affected users
|
||||||
if let Some(ref org_uuid) = self.organization_uuid {
|
if let Some(ref org_uuid) = self.organization_uuid {
|
||||||
for user_org in UserOrganization::find_by_cipher_and_org(&self.uuid, org_uuid, conn).await.iter() {
|
// users having access to the collection
|
||||||
User::update_uuid_revision(&user_org.user_uuid, conn).await;
|
let mut collection_users =
|
||||||
user_uuids.push(user_org.user_uuid.clone());
|
UserOrganization::find_by_cipher_and_org(&self.uuid, org_uuid, conn).await;
|
||||||
|
if CONFIG.org_groups_enabled() {
|
||||||
|
// members of a group having access to the collection
|
||||||
|
let group_users =
|
||||||
|
UserOrganization::find_by_cipher_and_org_with_group(&self.uuid, org_uuid, conn).await;
|
||||||
|
collection_users.extend(group_users);
|
||||||
}
|
}
|
||||||
for user_org in
|
for user_org in collection_users {
|
||||||
UserOrganization::find_by_cipher_and_org_with_group(&self.uuid, org_uuid, conn).await.iter()
|
|
||||||
{
|
|
||||||
User::update_uuid_revision(&user_org.user_uuid, conn).await;
|
User::update_uuid_revision(&user_org.user_uuid, conn).await;
|
||||||
user_uuids.push(user_org.user_uuid.clone());
|
user_uuids.push(user_org.user_uuid.clone())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue