aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorStefan Melmuk <[email protected]>2024-05-25 15:20:36 +0200
committerGitHub <[email protected]>2024-05-25 15:20:36 +0200
commitf01ef40a8ec1c59f81a575faad90bde73d3e9d48 (patch)
treec9734ab8b981a401dca6337af0cc5bc3d8d21abb /src/db
parent8e7b27cc36f02da6a02099be3bc5a59e42bcb1b6 (diff)
downloadvaultwarden-f01ef40a8ec1c59f81a575faad90bde73d3e9d48.tar.gz
vaultwarden-f01ef40a8ec1c59f81a575faad90bde73d3e9d48.zip
differentiate external groups by organization id (#4586)
Diffstat (limited to 'src/db')
-rw-r--r--src/db/models/group.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/db/models/group.rs b/src/db/models/group.rs
index e50853e2..7faf7566 100644
--- a/src/db/models/group.rs
+++ b/src/db/models/group.rs
@@ -203,10 +203,11 @@ impl Group {
}}
}
- pub async fn find_by_external_id(id: &str, conn: &mut DbConn) -> Option<Self> {
+ pub async fn find_by_external_id_and_org(external_id: &str, org_uuid: &str, conn: &mut DbConn) -> Option<Self> {
db_run! { conn: {
groups::table
- .filter(groups::external_id.eq(id))
+ .filter(groups::external_id.eq(external_id))
+ .filter(groups::organizations_uuid.eq(org_uuid))
.first::<GroupDb>(conn)
.ok()
.from_db()