[AC-1110] allow members with Delete Any Collection to delete collections (#4925)

* [AC-1110] add anyCollection permission to delete collection

* [AC-1110] add missing permission to header collection delete
This commit is contained in:
Jake Fink 2023-03-10 12:53:41 -05:00 committed by GitHub
parent 7892834f97
commit e480f7cfbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -116,7 +116,10 @@ export class BulkDeleteDialogComponent {
}
private async deleteCollections(): Promise<any> {
if (!this.organization.canDeleteAssignedCollections) {
if (
!this.organization.canDeleteAssignedCollections &&
!this.organization.canDeleteAnyCollection
) {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),

View File

@ -209,7 +209,10 @@ export class VaultHeaderComponent {
}
async deleteCollection(collection: CollectionView): Promise<void> {
if (!this.organization.canDeleteAssignedCollections) {
if (
!this.organization.canDeleteAnyCollection &&
!this.organization.canDeleteAssignedCollections
) {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),

View File

@ -244,7 +244,10 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
}
async deleteCollection(collection: CollectionView): Promise<void> {
if (!this.organization.canDeleteAssignedCollections) {
if (
!this.organization.canDeleteAssignedCollections &&
!this.organization.canDeleteAnyCollection
) {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
@ -270,6 +273,7 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
null,
this.i18nService.t("deletedCollectionId", collection.name)
);
this.actionPromise = null;
await this.refresh();
} catch (e) {
this.logService.error(e);