mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
MaximumVaultTimeout policy fixes (#1573)
This commit is contained in:
parent
34aba0e168
commit
c9ce7256e5
2 changed files with 30 additions and 20 deletions
|
@ -418,6 +418,21 @@ namespace Bit.App.Pages
|
|||
new SettingsPageListItem { Name = AppResources.LockNow },
|
||||
new SettingsPageListItem { Name = AppResources.TwoStepLogin }
|
||||
};
|
||||
if (_supportsBiometric || _biometric)
|
||||
{
|
||||
var biometricName = AppResources.Biometrics;
|
||||
if (Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
biometricName = _deviceActionService.SupportsFaceBiometric() ? AppResources.FaceID :
|
||||
AppResources.TouchID;
|
||||
}
|
||||
var item = new SettingsPageListItem
|
||||
{
|
||||
Name = string.Format(AppResources.UnlockWith, biometricName),
|
||||
SubLabel = _biometric ? AppResources.Enabled : AppResources.Disabled
|
||||
};
|
||||
securityItems.Insert(2, item);
|
||||
}
|
||||
if (_vaultTimeoutDisplayValue == AppResources.Custom)
|
||||
{
|
||||
securityItems.Insert(1, new SettingsPageListItem
|
||||
|
@ -437,21 +452,6 @@ namespace Bit.App.Pages
|
|||
UseFrame = true,
|
||||
});
|
||||
}
|
||||
if (_supportsBiometric || _biometric)
|
||||
{
|
||||
var biometricName = AppResources.Biometrics;
|
||||
if (Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
biometricName = _deviceActionService.SupportsFaceBiometric() ? AppResources.FaceID :
|
||||
AppResources.TouchID;
|
||||
}
|
||||
var item = new SettingsPageListItem
|
||||
{
|
||||
Name = string.Format(AppResources.UnlockWith, biometricName),
|
||||
SubLabel = _biometric ? AppResources.Enabled : AppResources.Disabled
|
||||
};
|
||||
securityItems.Insert(2, item);
|
||||
}
|
||||
var accountItems = new List<SettingsPageListItem>
|
||||
{
|
||||
new SettingsPageListItem { Name = AppResources.FingerprintPhrase },
|
||||
|
|
|
@ -220,10 +220,20 @@ namespace Bit.Core.Services
|
|||
o.Enabled &&
|
||||
o.Status >= OrganizationUserStatusType.Accepted &&
|
||||
o.UsePolicies &&
|
||||
!o.isExemptFromPolicies &&
|
||||
!isExcemptFromPolicies(o, policyType) &&
|
||||
policySet.Contains(o.Id));
|
||||
}
|
||||
|
||||
private bool isExcemptFromPolicies(Organization organization, PolicyType policyType)
|
||||
{
|
||||
if (policyType == PolicyType.MaximumVaultTimeout)
|
||||
{
|
||||
return organization.Type == OrganizationUserType.Owner;
|
||||
}
|
||||
|
||||
return organization.isExemptFromPolicies;
|
||||
}
|
||||
|
||||
public int? GetPolicyInt(Policy policy, string key)
|
||||
{
|
||||
if (policy.Data.ContainsKey(key))
|
||||
|
|
Loading…
Reference in a new issue