2022-05-09 14:21:52 +02:00
|
|
|
import { NgModule } from "@angular/core";
|
|
|
|
import { RouterModule, Routes } from "@angular/router";
|
|
|
|
|
2022-06-14 17:10:53 +02:00
|
|
|
import { AuthGuard } from "@bitwarden/angular/guards/auth.guard";
|
|
|
|
import { Permissions } from "@bitwarden/common/enums/permissions";
|
2022-05-09 14:21:52 +02:00
|
|
|
|
|
|
|
import { PermissionsGuard } from "./guards/permissions.guard";
|
|
|
|
import { OrganizationLayoutComponent } from "./layouts/organization-layout.component";
|
|
|
|
import { CollectionsComponent } from "./manage/collections.component";
|
|
|
|
import { EventsComponent } from "./manage/events.component";
|
|
|
|
import { GroupsComponent } from "./manage/groups.component";
|
|
|
|
import { ManageComponent } from "./manage/manage.component";
|
|
|
|
import { PeopleComponent } from "./manage/people.component";
|
|
|
|
import { PoliciesComponent } from "./manage/policies.component";
|
|
|
|
import { NavigationPermissionsService } from "./services/navigation-permissions.service";
|
|
|
|
import { AccountComponent } from "./settings/account.component";
|
|
|
|
import { OrganizationBillingComponent } from "./settings/organization-billing.component";
|
|
|
|
import { OrganizationSubscriptionComponent } from "./settings/organization-subscription.component";
|
|
|
|
import { SettingsComponent } from "./settings/settings.component";
|
|
|
|
import { TwoFactorSetupComponent } from "./settings/two-factor-setup.component";
|
|
|
|
import { ExposedPasswordsReportComponent } from "./tools/exposed-passwords-report.component";
|
|
|
|
import { InactiveTwoFactorReportComponent } from "./tools/inactive-two-factor-report.component";
|
|
|
|
import { ReusedPasswordsReportComponent } from "./tools/reused-passwords-report.component";
|
|
|
|
import { ToolsComponent } from "./tools/tools.component";
|
|
|
|
import { UnsecuredWebsitesReportComponent } from "./tools/unsecured-websites-report.component";
|
|
|
|
import { WeakPasswordsReportComponent } from "./tools/weak-passwords-report.component";
|
2022-08-08 21:08:35 +02:00
|
|
|
import { VaultModule } from "./vault/vault.module";
|
2022-05-09 14:21:52 +02:00
|
|
|
|
|
|
|
const routes: Routes = [
|
|
|
|
{
|
|
|
|
path: ":organizationId",
|
|
|
|
component: OrganizationLayoutComponent,
|
|
|
|
canActivate: [AuthGuard, PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
permissions: NavigationPermissionsService.getPermissions("admin"),
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{ path: "", pathMatch: "full", redirectTo: "vault" },
|
|
|
|
{
|
|
|
|
path: "vault",
|
2022-08-08 21:08:35 +02:00
|
|
|
loadChildren: () => VaultModule,
|
2022-05-09 14:21:52 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "tools",
|
|
|
|
component: ToolsComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: { permissions: NavigationPermissionsService.getPermissions("tools") },
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
pathMatch: "full",
|
|
|
|
redirectTo: "import",
|
|
|
|
},
|
|
|
|
{
|
2022-06-28 22:24:21 +02:00
|
|
|
path: "",
|
|
|
|
loadChildren: () =>
|
|
|
|
import("./tools/import-export/org-import-export.module").then(
|
|
|
|
(m) => m.OrganizationImportExportModule
|
|
|
|
),
|
2022-05-09 14:21:52 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "exposed-passwords-report",
|
|
|
|
component: ExposedPasswordsReportComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "exposedPasswordsReport",
|
|
|
|
permissions: [Permissions.AccessReports],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "inactive-two-factor-report",
|
|
|
|
component: InactiveTwoFactorReportComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "inactive2faReport",
|
|
|
|
permissions: [Permissions.AccessReports],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "reused-passwords-report",
|
|
|
|
component: ReusedPasswordsReportComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "reusedPasswordsReport",
|
|
|
|
permissions: [Permissions.AccessReports],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "unsecured-websites-report",
|
|
|
|
component: UnsecuredWebsitesReportComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "unsecuredWebsitesReport",
|
|
|
|
permissions: [Permissions.AccessReports],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "weak-passwords-report",
|
|
|
|
component: WeakPasswordsReportComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "weakPasswordsReport",
|
|
|
|
permissions: [Permissions.AccessReports],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "manage",
|
|
|
|
component: ManageComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
permissions: NavigationPermissionsService.getPermissions("manage"),
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
pathMatch: "full",
|
|
|
|
redirectTo: "people",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "collections",
|
|
|
|
component: CollectionsComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "collections",
|
|
|
|
permissions: [
|
|
|
|
Permissions.CreateNewCollections,
|
|
|
|
Permissions.EditAnyCollection,
|
|
|
|
Permissions.DeleteAnyCollection,
|
|
|
|
Permissions.EditAssignedCollections,
|
|
|
|
Permissions.DeleteAssignedCollections,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "events",
|
|
|
|
component: EventsComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "eventLogs",
|
|
|
|
permissions: [Permissions.AccessEventLogs],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "groups",
|
|
|
|
component: GroupsComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "groups",
|
|
|
|
permissions: [Permissions.ManageGroups],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "people",
|
|
|
|
component: PeopleComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "people",
|
|
|
|
permissions: [Permissions.ManageUsers, Permissions.ManageUsersPassword],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "policies",
|
|
|
|
component: PoliciesComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: {
|
|
|
|
titleId: "policies",
|
|
|
|
permissions: [Permissions.ManagePolicies],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "settings",
|
|
|
|
component: SettingsComponent,
|
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: { permissions: NavigationPermissionsService.getPermissions("settings") },
|
|
|
|
children: [
|
|
|
|
{ path: "", pathMatch: "full", redirectTo: "account" },
|
|
|
|
{ path: "account", component: AccountComponent, data: { titleId: "myOrganization" } },
|
|
|
|
{
|
|
|
|
path: "two-factor",
|
|
|
|
component: TwoFactorSetupComponent,
|
|
|
|
data: { titleId: "twoStepLogin" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "billing",
|
|
|
|
component: OrganizationBillingComponent,
|
2022-05-10 09:41:52 +02:00
|
|
|
canActivate: [PermissionsGuard],
|
|
|
|
data: { titleId: "billing", permissions: [Permissions.ManageBilling] },
|
2022-05-09 14:21:52 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "subscription",
|
|
|
|
component: OrganizationSubscriptionComponent,
|
|
|
|
data: { titleId: "subscription" },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [RouterModule.forChild(routes)],
|
|
|
|
exports: [RouterModule],
|
|
|
|
})
|
|
|
|
export class OrganizationsRoutingModule {}
|