1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-07-16 17:21:13 +00:00

differentiate external groups by organization id (#4586)

This commit is contained in:
Stefan Melmuk 2024-05-25 15:20:36 +02:00 committed by GitHub
parent 8e7b27cc36
commit f01ef40a8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -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()