1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-21 03:43:58 +00:00

[PM-26020] Implement dynamic cipher creation permissions in vault header and new… (#18579)

* Implement dynamic cipher creation permissions in vault header and new cipher menu components

* Enhance new cipher menu button behavior and accessibility. Implement dynamic button label based on creation permissions, allowing direct collection creation when applicable. Update button trigger logic to improve user experience.

* Update apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.ts

Co-authored-by: SmithThe4th <gsmith@bitwarden.com>

* Add canCreateCipher getter for improved readability

---------

Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
This commit is contained in:
Jared
2026-02-10 15:45:45 -05:00
committed by GitHub
parent 6f1a618714
commit 3b535802db
4 changed files with 58 additions and 8 deletions

View File

@@ -76,7 +76,7 @@
<div *ngIf="filter.type !== 'trash'" class="tw-shrink-0">
<vault-new-cipher-menu
[canCreateCipher]="true"
[canCreateCipher]="canCreateCipher"
[canCreateFolder]="true"
[canCreateSshKey]="true"
[canCreateCollection]="canCreateCollections"

View File

@@ -228,6 +228,10 @@ export class VaultHeaderComponent {
return this.collection.node.canDelete(organization);
}
get canCreateCipher(): boolean {
return !this.activeOrganization?.isProviderUser || this.activeOrganization?.isMember;
}
deleteCollection() {
this.onDeleteCollection.emit();
}