PM-11429 Users with Except PW permissions will not get Copy Password Option Vault V2 (#10831)

This commit is contained in:
Jason Ng 2024-08-30 15:38:37 -04:00 committed by GitHub
parent 95d04f264f
commit 963e339e4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,13 @@
<button type="button" bitMenuItem appCopyField="username" [cipher]="cipher">
{{ "copyUsername" | i18n }}
</button>
<button type="button" bitMenuItem appCopyField="password" [cipher]="cipher">
<button
*ngIf="cipher.viewPassword"
type="button"
bitMenuItem
appCopyField="password"
[cipher]="cipher"
>
{{ "copyPassword" | i18n }}
</button>
<button type="button" bitMenuItem appCopyField="totp" [cipher]="cipher">

View File

@ -62,12 +62,6 @@ describe("CopyCipherFieldService", () => {
expect(platformUtilsService.copyToClipboard).not.toHaveBeenCalled();
});
it("should return early when cipher.viewPassword is false", async () => {
cipher.viewPassword = false;
await service.copy(valueToCopy, actionType, cipher, skipReprompt);
expect(platformUtilsService.copyToClipboard).not.toHaveBeenCalled();
});
it("should copy value to clipboard", async () => {
await service.copy(valueToCopy, actionType, cipher, skipReprompt);
expect(platformUtilsService.copyToClipboard).toHaveBeenCalledWith(valueToCopy);

View File

@ -106,7 +106,7 @@ export class CopyCipherFieldService {
return;
}
if (valueToCopy == null || !cipher.viewPassword) {
if (valueToCopy == null) {
return;
}