Skip to content

Commit

Permalink
SELC-5831 use ListProductUsers to handle users section visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
OraldoDoci committed Oct 24, 2024
1 parent 9635568 commit 28d40c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function DashboardSideMenu({
const ptRoute = DASHBOARD_ROUTES.TECHPARTNER.path;
const { getAllProductsWithPermission } = usePermissions();

const canSeeUsers = getAllProductsWithPermission(Actions.ManageProductUsers).length > 0;
const canSeeUsers = getAllProductsWithPermission(Actions.ListProductUsers).length > 0;
const canSeeGroups = getAllProductsWithPermission(Actions.ManageProductGroups).length > 0;

const overviewPath = resolvePathVariables(overviewRoute, {
Expand Down
20 changes: 17 additions & 3 deletions src/services/__mocks__/partyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export const mockedParties: Array<Party> = [
Actions.ListActiveProducts,
Actions.ListAvailableProducts,
Actions.ManageProductGroups,
Actions.ListProductUsers,
Actions.ManageProductUsers,
Actions.AccessProductBackoffice,
Actions.ViewDelegations,
Expand Down Expand Up @@ -309,6 +310,7 @@ export const mockedParties: Array<Party> = [
userProductActions: [
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand All @@ -329,6 +331,7 @@ export const mockedParties: Array<Party> = [
Actions.ListAvailableProducts,
Actions.ManageProductGroups,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.AccessProductBackoffice,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand All @@ -348,6 +351,7 @@ export const mockedParties: Array<Party> = [
Actions.ListActiveProducts,
Actions.ListAvailableProducts,
Actions.ManageProductGroups,
Actions.ListProductUsers,
Actions.AccessProductBackoffice,
],
},
Expand All @@ -362,7 +366,7 @@ export const mockedParties: Array<Party> = [
recipientCode: 'NBG455B',
publicServices: true,
},
userProductActions: [Actions.AccessProductBackoffice, Actions.ManageProductUsers],
userProductActions: [Actions.AccessProductBackoffice, Actions.ManageProductUsers, Actions.ListProductUsers],
},
{
productId: 'prod-interop-coll',
Expand All @@ -374,7 +378,7 @@ export const mockedParties: Array<Party> = [
recipientCode: 'NBG455B',
publicServices: true,
},
userProductActions: [Actions.AccessProductBackoffice, Actions.ManageProductUsers]
userProductActions: [Actions.AccessProductBackoffice, Actions.ManageProductUsers, Actions.ListProductUsers]
},
{
productId: 'prod-interop-atst',
Expand All @@ -386,7 +390,7 @@ export const mockedParties: Array<Party> = [
recipientCode: 'NBG455B',
publicServices: true,
},
userProductActions: [Actions.AccessProductBackoffice, Actions.ManageProductUsers]
userProductActions: [Actions.AccessProductBackoffice, Actions.ManageProductUsers, Actions.ListProductUsers]
},
{
productId: 'prod-pn',
Expand All @@ -400,6 +404,7 @@ export const mockedParties: Array<Party> = [
userProductActions: [
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand Down Expand Up @@ -456,6 +461,7 @@ export const mockedParties: Array<Party> = [
Actions.ListActiveProducts,
Actions.AccessProductBackoffice,
Actions.ViewBilling,
Actions.ListProductUsers,
],
},
],
Expand Down Expand Up @@ -497,6 +503,7 @@ export const mockedParties: Array<Party> = [
Actions.ListAvailableProducts,
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand All @@ -517,6 +524,7 @@ export const mockedParties: Array<Party> = [
userProductActions: [
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand Down Expand Up @@ -561,6 +569,7 @@ export const mockedParties: Array<Party> = [
Actions.ListAvailableProducts,
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand All @@ -578,6 +587,7 @@ export const mockedParties: Array<Party> = [
},
userProductActions: [
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand Down Expand Up @@ -619,6 +629,7 @@ export const mockedParties: Array<Party> = [
},
userProductActions: [
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand Down Expand Up @@ -677,6 +688,7 @@ export const mockedParties: Array<Party> = [
Actions.ListAvailableProducts,
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand Down Expand Up @@ -707,6 +719,7 @@ export const mockedParties: Array<Party> = [
Actions.ListAvailableProducts,
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewManagedInstitutions,
Expand Down Expand Up @@ -1214,6 +1227,7 @@ export const mockedParties: Array<Party> = [
Actions.ListAvailableProducts,
Actions.AccessProductBackoffice,
Actions.ManageProductUsers,
Actions.ListProductUsers,
Actions.ManageProductGroups,
Actions.ViewDelegations,
Actions.ViewBilling,
Expand Down

0 comments on commit 28d40c2

Please sign in to comment.