mirror of
https://github.com/bitwarden/browser
synced 2026-01-08 03:23:50 +00:00
[AC-1347] Allow editing of collections in individual vault (#6081)
* Rename Collection events to be more explicit * Implement edit collection for individual vault row * Implement edit and delete collection from individual vault header * Implement bulk delete for collections in individual vault * Clean up CollectionDialogResult properties * Centralize canEdit and canDelete logic to Collection models * Check orgId in canEdit and canDelete and add clarifying comments --------- Co-authored-by: Shane Melton <smelton@bitwarden.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { CollectionAccessDetailsResponse } from "@bitwarden/common/src/vault/models/response/collection.response";
|
||||
import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view";
|
||||
|
||||
@@ -29,4 +30,12 @@ export class CollectionAdminView extends CollectionView {
|
||||
|
||||
this.assigned = response.assigned;
|
||||
}
|
||||
|
||||
override canEdit(org: Organization): boolean {
|
||||
return org?.canEditAnyCollection || (org?.canEditAssignedCollections && this.assigned);
|
||||
}
|
||||
|
||||
override canDelete(org: Organization): boolean {
|
||||
return org?.canDeleteAnyCollection || (org?.canDeleteAssignedCollections && this.assigned);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user