[PM-4837] Hide TOTP seed copy button when Can view, except password permission set (#2869)

* Hide TOTP seed copy button when Can view, except password permission set

* additional check

* removal of null check
This commit is contained in:
mpbw2 2023-12-11 16:40:09 -05:00 committed by GitHub
parent 9a28419a4e
commit b90e030b8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -292,7 +292,7 @@
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="{Binding Source={x:Static core:BitwardenIcons.Clone}}" Text="{Binding Source={x:Static core:BitwardenIcons.Clone}}"
Command="{Binding CopyCommand}" Command="{Binding CopyCommand}"
IsVisible="{Binding HasTotpValue}" IsVisible="{Binding AllowTotpCopy}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" Grid.RowSpan="2"

View file

@ -307,6 +307,7 @@ namespace Bit.App.Pages
public bool PasswordPrompt => Cipher.Reprompt != CipherRepromptType.None; public bool PasswordPrompt => Cipher.Reprompt != CipherRepromptType.None;
public string PasswordVisibilityAccessibilityText => ShowPassword ? AppResources.PasswordIsVisibleTapToHide : AppResources.PasswordIsNotVisibleTapToShow; public string PasswordVisibilityAccessibilityText => ShowPassword ? AppResources.PasswordIsVisibleTapToHide : AppResources.PasswordIsNotVisibleTapToShow;
public bool HasTotpValue => IsLogin && !string.IsNullOrEmpty(Cipher?.Login?.Totp); public bool HasTotpValue => IsLogin && !string.IsNullOrEmpty(Cipher?.Login?.Totp);
public bool AllowTotpCopy => HasTotpValue && Cipher.ViewPassword;
public string SetupTotpText => $"{BitwardenIcons.Camera} {AppResources.SetupTotp}"; public string SetupTotpText => $"{BitwardenIcons.Camera} {AppResources.SetupTotp}";
public bool ShowPasskeyInfo => Cipher?.HasFido2Credential == true && !CloneMode; public bool ShowPasskeyInfo => Cipher?.HasFido2Credential == true && !CloneMode;