diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 9dd3a5d2..309fed6b 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -2005,7 +2005,7 @@ async fn validate_org_import_collections( && !membership.has_type(MembershipType::Manager) { Some( - Collection::find_manageable_by_any_assignment(org_id, &membership.user_uuid, conn) + Collection::find_explicitly_manageable_by_user(org_id, &membership.user_uuid, conn) .await .into_iter() .collect::>(), diff --git a/src/db/models/collection.rs b/src/db/models/collection.rs index 6d85b15f..4f1533e3 100644 --- a/src/db/models/collection.rs +++ b/src/db/models/collection.rs @@ -663,25 +663,6 @@ impl Collection { org_uuid: &OrganizationId, user_uuid: &UserId, conn: &DbConn, - ) -> Vec { - Self::find_manageable_by_option(org_uuid, user_uuid, false, conn).await - } - - /// [`Collection::find_explicitly_manageable_by_user`], but like Bitwarden the manage option of any assignment - /// counts: a direct assignment without it doesn't hide the one of a group. - pub async fn find_manageable_by_any_assignment( - org_uuid: &OrganizationId, - user_uuid: &UserId, - conn: &DbConn, - ) -> Vec { - Self::find_manageable_by_option(org_uuid, user_uuid, true, conn).await - } - - async fn find_manageable_by_option( - org_uuid: &OrganizationId, - user_uuid: &UserId, - any_assignment: bool, - conn: &DbConn, ) -> Vec { let org_uuid = org_uuid.to_string(); let user_uuid = user_uuid.to_string(); @@ -710,7 +691,6 @@ impl Collection { users_collections::manage.eq(true).or(users_collections::user_uuid .is_null() .or(users_organizations::atype.eq(MembershipType::Manager as i32)) - .or::<_, diesel::sql_types::Bool>(any_assignment) .and(collections_groups::manage.eq(true)) .and::<_, diesel::sql_types::Bool>(groups_enabled)), )