mirror of
https://github.com/bitwarden/server
synced 2026-01-06 02:23:51 +00:00
[PM-13322] [BEEEP] Add PolicyValidators and refactor policy save logic (#4877)
This commit is contained in:
@@ -16,3 +16,30 @@ public enum PolicyType : byte
|
||||
ActivateAutofill = 11,
|
||||
AutomaticAppLogIn = 12,
|
||||
}
|
||||
|
||||
public static class PolicyTypeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the name of the policy for display to the user.
|
||||
/// Do not include the word "policy" in the return value.
|
||||
/// </summary>
|
||||
public static string GetName(this PolicyType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
PolicyType.TwoFactorAuthentication => "Require two-step login",
|
||||
PolicyType.MasterPassword => "Master password requirements",
|
||||
PolicyType.PasswordGenerator => "Password generator",
|
||||
PolicyType.SingleOrg => "Single organization",
|
||||
PolicyType.RequireSso => "Require single sign-on authentication",
|
||||
PolicyType.PersonalOwnership => "Remove individual vault",
|
||||
PolicyType.DisableSend => "Remove Send",
|
||||
PolicyType.SendOptions => "Send options",
|
||||
PolicyType.ResetPassword => "Account recovery administration",
|
||||
PolicyType.MaximumVaultTimeout => "Vault timeout",
|
||||
PolicyType.DisablePersonalVaultExport => "Remove individual vault export",
|
||||
PolicyType.ActivateAutofill => "Active auto-fill",
|
||||
PolicyType.AutomaticAppLogIn => "Automatically log in users for allowed applications",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user