From b4b51e1d60fba4e63d7a6f3eff31ccf3bb590d98 Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Thu, 27 Oct 2022 13:37:30 -0700 Subject: [PATCH] [EC-646] Re-introduce the canAccessManageTab helper --- .../organization.service.abstraction.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/common/src/abstractions/organization/organization.service.abstraction.ts b/libs/common/src/abstractions/organization/organization.service.abstraction.ts index 93a6143790..0a7ceac925 100644 --- a/libs/common/src/abstractions/organization/organization.service.abstraction.ts +++ b/libs/common/src/abstractions/organization/organization.service.abstraction.ts @@ -24,6 +24,20 @@ export function canAccessBillingTab(org: Organization): boolean { return org.canManageBilling; } +export function canManageCollections(org: Organization): boolean { + return ( + org.canCreateNewCollections || + org.canEditAnyCollection || + org.canDeleteAnyCollection || + org.canEditAssignedCollections || + org.canDeleteAssignedCollections + ); +} + +export function canAccessManageTab(org: Organization): boolean { + return canAccessMembersTab(org) || canAccessGroupsTab(org) || canManageCollections(org); +} + export function canAccessOrgAdmin(org: Organization): boolean { return ( canAccessMembersTab(org) ||