diff --git a/web/src/app/app/settings/attributes/page.tsx b/web/src/app/app/settings/(permissions)/attributes/page.tsx similarity index 65% rename from web/src/app/app/settings/attributes/page.tsx rename to web/src/app/app/settings/(permissions)/attributes/page.tsx index 3a8632f40..bdcfe87bb 100644 --- a/web/src/app/app/settings/attributes/page.tsx +++ b/web/src/app/app/settings/(permissions)/attributes/page.tsx @@ -1,8 +1,8 @@ 'use client'; import React from 'react'; -import { SettingsEmptyState } from '../_SettingsEmptyState'; -import { SettingsPageHeader } from '../_SettingsPageHeader'; +import { SettingsEmptyState } from '../../_components/SettingsEmptyState'; +import { SettingsPageHeader } from '../../_components/SettingsPageHeader'; export default function Page() { return ( diff --git a/web/src/app/app/settings/dataset-groups/ListDatasetGroupsComponent.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/ListDatasetGroupsComponent.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/ListDatasetGroupsComponent.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/ListDatasetGroupsComponent.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/DatasetGroupAppSegments.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/DatasetGroupAppSegments.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/DatasetGroupAppSegments.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/DatasetGroupAppSegments.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/DatasetGroupBackButton.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/DatasetGroupBackButton.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/DatasetGroupBackButton.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/DatasetGroupBackButton.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/DatasetGroupTitleAndDescription.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/DatasetGroupTitleAndDescription.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/DatasetGroupTitleAndDescription.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/DatasetGroupTitleAndDescription.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetSelectedPopup.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsController.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsController.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsController.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsController.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/page.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/page.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/page.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/page.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/layout.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/layout.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/layout.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/layout.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetGroupsController.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetGroupsController.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetGroupsController.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetGroupsController.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetSelectedPopup.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/page.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/page.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/permission-groups/page.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/page.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersController.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersController.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersController.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersController.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersSelectedPopup.tsx diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/page.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/page.tsx similarity index 100% rename from web/src/app/app/settings/dataset-groups/[datasetGroupId]/users/page.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/page.tsx diff --git a/web/src/app/app/settings/dataset-groups/page.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/page.tsx similarity index 96% rename from web/src/app/app/settings/dataset-groups/page.tsx rename to web/src/app/app/settings/(permissions)/dataset-groups/page.tsx index 89216ad53..079431c25 100644 --- a/web/src/app/app/settings/dataset-groups/page.tsx +++ b/web/src/app/app/settings/(permissions)/dataset-groups/page.tsx @@ -1,6 +1,6 @@ 'use client'; import React, { useState } from 'react'; -import { SettingsPageHeader } from '../_SettingsPageHeader'; +import { SettingsPageHeader } from '../../_components/SettingsPageHeader'; import { PermissionSearch, NewDatasetGroupModal } from '@appComponents/PermissionComponents'; import { useDebounceSearch } from '@/hooks/useDebounceSearch'; import { useListDatasetGroups } from '@/api/buster_rest'; diff --git a/web/src/app/app/settings/(permissions)/layout.tsx b/web/src/app/app/settings/(permissions)/layout.tsx new file mode 100644 index 000000000..98f76ee88 --- /dev/null +++ b/web/src/app/app/settings/(permissions)/layout.tsx @@ -0,0 +1,17 @@ +import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes'; +import { useCheckIfUserIsAdmin_server } from '@/server_context/user'; +import { redirect } from 'next/navigation'; + +export default async function Layout({ children }: { children: React.ReactNode }) { + const isAdmin = await useCheckIfUserIsAdmin_server(); + + if (!isAdmin) { + return redirect( + createBusterRoute({ + route: BusterRoutes.SETTINGS_GENERAL + }) + ); + } + + return <>{children}>; +} diff --git a/web/src/app/app/settings/permission-groups/ListPermissionGroupsComponent.tsx b/web/src/app/app/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/ListPermissionGroupsComponent.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/PermissionAppSegments.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/PermissionAppSegments.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/PermissionAppSegments.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/PermissionAppSegments.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/PermissionBackButton.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/PermissionBackButton.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/PermissionBackButton.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/PermissionBackButton.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/PermissionGroupTitleAndDescription.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/PermissionGroupTitleAndDescription.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/PermissionGroupTitleAndDescription.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/PermissionGroupTitleAndDescription.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetGroupsController.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetGroupsController.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetGroupsController.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetGroupsController.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetSelectedPopup.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/page.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/page.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/dataset-groups/page.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/page.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetSelectedPopup.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsController.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsController.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsController.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsController.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/page.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/page.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/page.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/page.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/layout.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/layout.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/layout.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/layout.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/users/PermissionGroupUsersController.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersController.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/users/PermissionGroupUsersController.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersController.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/users/PermissionGroupUsersSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/users/PermissionGroupUsersSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersSelectedPopup.tsx diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/users/page.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/page.tsx similarity index 100% rename from web/src/app/app/settings/permission-groups/[permissionGroupId]/users/page.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/page.tsx diff --git a/web/src/app/app/settings/permission-groups/page.tsx b/web/src/app/app/settings/(permissions)/permission-groups/page.tsx similarity index 96% rename from web/src/app/app/settings/permission-groups/page.tsx rename to web/src/app/app/settings/(permissions)/permission-groups/page.tsx index 95fdb2277..f4cfac6a8 100644 --- a/web/src/app/app/settings/permission-groups/page.tsx +++ b/web/src/app/app/settings/(permissions)/permission-groups/page.tsx @@ -1,6 +1,6 @@ 'use client'; import React, { useState } from 'react'; -import { SettingsPageHeader } from '../_SettingsPageHeader'; +import { SettingsPageHeader } from '../../_components/SettingsPageHeader'; import { PermissionSearch, NewPermissionGroupModal } from '@appComponents/PermissionComponents'; import { useDebounceSearch } from '@/hooks/useDebounceSearch'; import { useListAllPermissionGroups } from '@/api/buster_rest'; diff --git a/web/src/app/app/settings/users/ListUsersComponent.tsx b/web/src/app/app/settings/(permissions)/users/ListUsersComponent.tsx similarity index 97% rename from web/src/app/app/settings/users/ListUsersComponent.tsx rename to web/src/app/app/settings/(permissions)/users/ListUsersComponent.tsx index e17f1b84b..e5683ccc3 100644 --- a/web/src/app/app/settings/users/ListUsersComponent.tsx +++ b/web/src/app/app/settings/(permissions)/users/ListUsersComponent.tsx @@ -11,7 +11,7 @@ import React, { useMemo, useState } from 'react'; import { Text } from '@/components/text'; import { OrganizationUserRoleText } from './config'; import { BusterRoutes, createBusterRoute } from '@/routes'; -import { ListUserItem } from '../../_components/ListContent'; +import { ListUserItem } from '../../../_components/ListContent'; export const ListUsersComponent: React.FC<{ users: OrganizationUser[]; diff --git a/web/src/app/app/settings/users/UserListPopupContainer.tsx b/web/src/app/app/settings/(permissions)/users/UserListPopupContainer.tsx similarity index 100% rename from web/src/app/app/settings/users/UserListPopupContainer.tsx rename to web/src/app/app/settings/(permissions)/users/UserListPopupContainer.tsx diff --git a/web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/LayoutHeaderAndSegment.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/LayoutHeaderAndSegment.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/LayoutHeaderAndSegment.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/LayoutHeaderAndSegment.tsx diff --git a/web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/UserHeader.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/UserHeader.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/UserHeader.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/UserHeader.tsx diff --git a/web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/UserSegments.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/UserSegments.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/UserSegments.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/UserSegments.tsx diff --git a/web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/UsersBackButton.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/UsersBackButton.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/UsersBackButton.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/UsersBackButton.tsx diff --git a/web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/index.ts b/web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/index.ts similarity index 100% rename from web/src/app/app/settings/users/[userId]/_LayoutHeaderAndSegment/index.ts rename to web/src/app/app/settings/(permissions)/users/[userId]/_LayoutHeaderAndSegment/index.ts diff --git a/web/src/app/app/settings/users/[userId]/_overview/UserDatasetListContainer.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserDatasetListContainer.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_overview/UserDatasetListContainer.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserDatasetListContainer.tsx diff --git a/web/src/app/app/settings/users/[userId]/_overview/UserDatasetSearch.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserDatasetSearch.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_overview/UserDatasetSearch.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserDatasetSearch.tsx diff --git a/web/src/app/app/settings/users/[userId]/_overview/UserDefaultAccess.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserDefaultAccess.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_overview/UserDefaultAccess.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserDefaultAccess.tsx diff --git a/web/src/app/app/settings/users/[userId]/_overview/UserLineageHeader.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserLineageHeader.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_overview/UserLineageHeader.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserLineageHeader.tsx diff --git a/web/src/app/app/settings/users/[userId]/_overview/UserOverviewController.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserOverviewController.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/_overview/UserOverviewController.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/_overview/UserOverviewController.tsx diff --git a/web/src/app/app/settings/users/[userId]/attributes/UserAttributesController.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/attributes/UserAttributesController.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/attributes/UserAttributesController.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/attributes/UserAttributesController.tsx diff --git a/web/src/app/app/settings/users/[userId]/attributes/UserAttributesListContainer.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/attributes/UserAttributesListContainer.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/attributes/UserAttributesListContainer.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/attributes/UserAttributesListContainer.tsx diff --git a/web/src/app/app/settings/users/[userId]/attributes/UserAttributesSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/attributes/UserAttributesSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/attributes/UserAttributesSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/attributes/UserAttributesSelectedPopup.tsx diff --git a/web/src/app/app/settings/users/[userId]/attributes/page.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/attributes/page.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/attributes/page.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/attributes/page.tsx diff --git a/web/src/app/app/settings/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx diff --git a/web/src/app/app/settings/users/[userId]/dataset-groups/UserDatasetGroupSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/dataset-groups/UserDatasetGroupSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupSelectedPopup.tsx diff --git a/web/src/app/app/settings/users/[userId]/dataset-groups/UserDatasetGroupsController.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupsController.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/dataset-groups/UserDatasetGroupsController.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupsController.tsx diff --git a/web/src/app/app/settings/users/[userId]/dataset-groups/page.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/page.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/dataset-groups/page.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/dataset-groups/page.tsx diff --git a/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsController.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/datasets/UserDatasetsController.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/datasets/UserDatasetsController.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/datasets/UserDatasetsController.tsx diff --git a/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/datasets/UserDatasetsListContainer.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/datasets/UserDatasetsListContainer.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/datasets/UserDatasetsListContainer.tsx diff --git a/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/datasets/UserDatasetsSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/datasets/UserDatasetsSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/datasets/UserDatasetsSelectedPopup.tsx diff --git a/web/src/app/app/settings/users/[userId]/datasets/page.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/datasets/page.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/datasets/page.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/datasets/page.tsx diff --git a/web/src/app/app/settings/users/[userId]/layout.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/layout.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/layout.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/layout.tsx diff --git a/web/src/app/app/settings/users/[userId]/page.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/page.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/page.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/page.tsx diff --git a/web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupSelectedPopup.tsx diff --git a/web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsController.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsController.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsController.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsController.tsx diff --git a/web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx diff --git a/web/src/app/app/settings/users/[userId]/permission-groups/page.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/page.tsx similarity index 97% rename from web/src/app/app/settings/users/[userId]/permission-groups/page.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/page.tsx index fe272da91..b3c2361c8 100644 --- a/web/src/app/app/settings/users/[userId]/permission-groups/page.tsx +++ b/web/src/app/app/settings/(permissions)/users/[userId]/permission-groups/page.tsx @@ -1,7 +1,7 @@ import { prefetchGetUserPermissionGroups } from '@/api/buster_rest/users'; import { HydrationBoundary, dehydrate } from '@tanstack/react-query'; import { UserPermissionGroupsController } from './UserPermissionGroupsController'; -import { useCheckIfUserIsAdmin_server } from '../../../../../../server_context/user'; +import { useCheckIfUserIsAdmin_server } from '../../../../../../../server_context/user'; import { redirect } from 'next/navigation'; import { BusterRoutes, createBusterRoute } from '@/routes'; diff --git a/web/src/app/app/settings/users/[userId]/teams/UserTeamsController.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/teams/UserTeamsController.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/teams/UserTeamsController.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/teams/UserTeamsController.tsx diff --git a/web/src/app/app/settings/users/[userId]/teams/UserTeamsListContainer.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/teams/UserTeamsListContainer.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/teams/UserTeamsListContainer.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/teams/UserTeamsListContainer.tsx diff --git a/web/src/app/app/settings/users/[userId]/teams/UserTeamsSelectedPopup.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/teams/UserTeamsSelectedPopup.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/teams/UserTeamsSelectedPopup.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/teams/UserTeamsSelectedPopup.tsx diff --git a/web/src/app/app/settings/users/[userId]/teams/page.tsx b/web/src/app/app/settings/(permissions)/users/[userId]/teams/page.tsx similarity index 100% rename from web/src/app/app/settings/users/[userId]/teams/page.tsx rename to web/src/app/app/settings/(permissions)/users/[userId]/teams/page.tsx diff --git a/web/src/app/app/settings/users/config.ts b/web/src/app/app/settings/(permissions)/users/config.ts similarity index 100% rename from web/src/app/app/settings/users/config.ts rename to web/src/app/app/settings/(permissions)/users/config.ts diff --git a/web/src/app/app/settings/users/page.tsx b/web/src/app/app/settings/(permissions)/users/page.tsx similarity index 89% rename from web/src/app/app/settings/users/page.tsx rename to web/src/app/app/settings/(permissions)/users/page.tsx index 7417f0d74..bdb2c3da7 100644 --- a/web/src/app/app/settings/users/page.tsx +++ b/web/src/app/app/settings/(permissions)/users/page.tsx @@ -1,12 +1,12 @@ 'use client'; import React from 'react'; -import { SettingsPageHeader } from '../_SettingsPageHeader'; +import { SettingsPageHeader } from '../../_components/SettingsPageHeader'; import { useDebounceSearch } from '@/hooks/useDebounceSearch'; import { useGetOrganizationUsers } from '@/api/buster_rest'; import { useUserConfigContextSelector } from '@/context/Users'; import { ListUsersComponent } from './ListUsersComponent'; -import { PermissionSearch } from '../../_components/PermissionComponents'; +import { PermissionSearch } from '../../../_components/PermissionComponents'; export default function Page() { const userOrganization = useUserConfigContextSelector((x) => x.userOrganizations); diff --git a/web/src/app/app/settings/(restricted-width)/api-keys/page.tsx b/web/src/app/app/settings/(restricted-width)/api-keys/page.tsx index 7ab8d4346..0ec442262 100644 --- a/web/src/app/app/settings/(restricted-width)/api-keys/page.tsx +++ b/web/src/app/app/settings/(restricted-width)/api-keys/page.tsx @@ -1,5 +1,5 @@ import { useCheckIfUserIsAdmin_server } from '../../../../../server_context/user'; -import { SettingsPageHeader } from '../../_SettingsPageHeader'; +import { SettingsPageHeader } from '../../_components/SettingsPageHeader'; import { ApiKeysController } from './ApiKeysController'; import { createBusterRoute, BusterRoutes } from '@/routes'; import { redirect } from 'next/navigation'; diff --git a/web/src/app/app/settings/(restricted-width)/billing/page.tsx b/web/src/app/app/settings/(restricted-width)/billing/page.tsx index a5fda1971..895092e59 100644 --- a/web/src/app/app/settings/(restricted-width)/billing/page.tsx +++ b/web/src/app/app/settings/(restricted-width)/billing/page.tsx @@ -1,7 +1,20 @@ -import { SettingsEmptyState } from '../../_SettingsEmptyState'; -import { SettingsPageHeader } from '../../_SettingsPageHeader'; +import { SettingsEmptyState } from '../../_components/SettingsEmptyState'; +import { SettingsPageHeader } from '../../_components/SettingsPageHeader'; +import { redirect } from 'next/navigation'; +import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes'; +import { useCheckIfUserIsAdmin_server } from '@/server_context/user'; + +export default async function Page() { + const isAdmin = await useCheckIfUserIsAdmin_server(); + + if (!isAdmin) { + return redirect( + createBusterRoute({ + route: BusterRoutes.SETTINGS_GENERAL + }) + ); + } -export default function Page() { return (