Skip to content

Commit

Permalink
rename policy check
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan0xC committed Sep 15, 2024
1 parent 0977c02 commit 62fb9c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/core/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async fn is_email_2fa_required(org_user_uuid: Option<String>, conn: &mut DbConn)
return true;
}
if org_user_uuid.is_some() {
return OrgPolicy::is_enabled_by_org(&org_user_uuid.unwrap(), OrgPolicyType::TwoFactorAuthentication, conn)
return OrgPolicy::is_enabled_for_member(&org_user_uuid.unwrap(), OrgPolicyType::TwoFactorAuthentication, conn)
.await;
}
false
Expand Down
2 changes: 1 addition & 1 deletion src/db/models/org_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl OrgPolicy {
false
}

pub async fn is_enabled_by_org(org_user_uuid: &str, policy_type: OrgPolicyType, conn: &mut DbConn) -> bool {
pub async fn is_enabled_for_member(org_user_uuid: &str, policy_type: OrgPolicyType, conn: &mut DbConn) -> bool {
if let Some(membership) = UserOrganization::find_by_uuid(org_user_uuid, conn).await {
if let Some(policy) = OrgPolicy::find_by_org_and_type(&membership.org_uuid, policy_type, conn).await {
return policy.enabled;
Expand Down

0 comments on commit 62fb9c1

Please sign in to comment.