mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
PM-11429 Users with Except PW permissions will not get Copy Password Option Vault V2 (#10831)
This commit is contained in:
@@ -13,7 +13,13 @@
|
|||||||
<button type="button" bitMenuItem appCopyField="username" [cipher]="cipher">
|
<button type="button" bitMenuItem appCopyField="username" [cipher]="cipher">
|
||||||
{{ "copyUsername" | i18n }}
|
{{ "copyUsername" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" bitMenuItem appCopyField="password" [cipher]="cipher">
|
<button
|
||||||
|
*ngIf="cipher.viewPassword"
|
||||||
|
type="button"
|
||||||
|
bitMenuItem
|
||||||
|
appCopyField="password"
|
||||||
|
[cipher]="cipher"
|
||||||
|
>
|
||||||
{{ "copyPassword" | i18n }}
|
{{ "copyPassword" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" bitMenuItem appCopyField="totp" [cipher]="cipher">
|
<button type="button" bitMenuItem appCopyField="totp" [cipher]="cipher">
|
||||||
|
|||||||
@@ -62,12 +62,6 @@ describe("CopyCipherFieldService", () => {
|
|||||||
expect(platformUtilsService.copyToClipboard).not.toHaveBeenCalled();
|
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 () => {
|
it("should copy value to clipboard", async () => {
|
||||||
await service.copy(valueToCopy, actionType, cipher, skipReprompt);
|
await service.copy(valueToCopy, actionType, cipher, skipReprompt);
|
||||||
expect(platformUtilsService.copyToClipboard).toHaveBeenCalledWith(valueToCopy);
|
expect(platformUtilsService.copyToClipboard).toHaveBeenCalledWith(valueToCopy);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export class CopyCipherFieldService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (valueToCopy == null || !cipher.viewPassword) {
|
if (valueToCopy == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user