1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-26 05:50:29 +01:00

Ensure that a user is actually in an org when applying policies

Dieser Commit ist enthalten in:
Ave 2020-11-08 01:14:17 +03:00
Ursprung b5f9fe4d3b
Commit fa364c3f2c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 398DD7BD03276F6D

Datei anzeigen

@ -4,7 +4,7 @@ use crate::api::EmptyResult;
use crate::db::DbConn; use crate::db::DbConn;
use crate::error::MapResult; use crate::error::MapResult;
use super::Organization; use super::{Organization, UserOrgStatus};
db_object! { db_object! {
#[derive(Debug, Identifiable, Queryable, Insertable, Associations, AsChangeset)] #[derive(Debug, Identifiable, Queryable, Insertable, Associations, AsChangeset)]
@ -134,6 +134,9 @@ impl OrgPolicy {
users_organizations::org_uuid.eq(org_policies::org_uuid) users_organizations::org_uuid.eq(org_policies::org_uuid)
.and(users_organizations::user_uuid.eq(user_uuid))) .and(users_organizations::user_uuid.eq(user_uuid)))
) )
.filter(
users_organizations::status.eq(UserOrgStatus::Confirmed as i32)
)
.select(org_policies::all_columns) .select(org_policies::all_columns)
.load::<OrgPolicyDb>(conn) .load::<OrgPolicyDb>(conn)
.expect("Error loading org_policy") .expect("Error loading org_policy")