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:
@@ -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"
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user