import {UploadComponent} from "./modules/repo/upload/upload.component";
import {ManageRolesComponent} from "./modules/user/manage-roles/manage-roles.component";
import {SecurityConfigurationComponent} from "./modules/user/security-configuration/security-configuration.component";
-import {ManageUsersListComponent} from "./modules/user/users/manage-users-list/manage-users-list.component";
-import {ManageUsersAddComponent} from "./modules/user/users/manage-users-add/manage-users-add.component";
-import {ManageUsersEditComponent} from "./modules/user/users/manage-users-edit/manage-users-edit.component";
import {RoutingGuardService as Guard} from "./services/routing-guard.service";
-import {ManageUsersDeleteComponent} from "./modules/user/users/manage-users-delete/manage-users-delete.component";
import {UserModule} from "./modules/user/user.module";
-import { ManageUsersComponent } from './modules/user/users/manage-users/manage-users.component';
/**
* You can use Guard (RoutingGuardService) for permission checking. The service needs data with one parameter 'perm',
{path:'repo/upload', component: UploadComponent},
{path:'', redirectTo:'repo/search', pathMatch:'full'},
]},
+ { path: 'users', loadChildren: () => import('./modules/user/user.module').then(m => m.UserModule)
+ },
{ path: 'user', component: HomeComponent,canActivate:[Guard],data:{perm: 'menu.user.section'},
children: [
- { path: 'users', component: ManageUsersComponent,canActivate:[Guard],
- data: { perm: 'menu.user.manage' },
- children: [
- {path: 'list', component: ManageUsersListComponent},
- {path: 'add', component: ManageUsersAddComponent},
- {path: 'edit/:userid', component: ManageUsersEditComponent},
- {path: 'edit', redirectTo:'edit/guest' },
- {path: 'delete/:userid', component: ManageUsersDeleteComponent},
- {path: '', redirectTo:'list', pathMatch:'full'}
- ]
- },
{ path: 'roles', component: ManageRolesComponent },
{ path: 'config', component: SecurityConfigurationComponent},
]
{ path: 'login', component: LoginComponent },
{ path: 'logout', component: HomeComponent },
{ path: '**', component: NotFoundComponent }
+ ,
+ {
+ path: '',
+ redirectTo: '',
+ pathMatch: 'full'
+ }
];
@NgModule({
- imports: [RouterModule.forRoot(routes)],
+ imports: [RouterModule.forRoot(routes), UserModule],
exports: [RouterModule],
declarations: []
})
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { ManageUsersComponent } from './users/manage-users/manage-users.component';
+import { ManageUsersListComponent } from './users/manage-users-list/manage-users-list.component';
+import { ManageUsersAddComponent } from './users/manage-users-add/manage-users-add.component';
+import { ManageUsersEditComponent } from './users/manage-users-edit/manage-users-edit.component';
+import { ManageUsersDeleteComponent } from './users/manage-users-delete/manage-users-delete.component';
+
+
+/**
+ * You can use Guard (RoutingGuardService) for permission checking. The service needs data with one parameter 'perm',
+ * that gives the path of the uiPermission map of the user service.
+ */
+
+const routes: Routes = [
+ { path: 'users', component: ManageUsersComponent,
+ data: { perm: 'menu.user.manage' },
+ children: [
+ {path: 'list', component: ManageUsersListComponent},
+ {path: 'add', component: ManageUsersAddComponent},
+ {path: 'edit/:userid', component: ManageUsersEditComponent},
+ {path: 'edit', redirectTo:'edit/guest' },
+ {path: 'delete/:userid', component: ManageUsersDeleteComponent},
+ ]
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+ declarations: []
+})
+export class UserRoutingModule { }
+
* under the License.
*/
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
import {ManageUsersComponent} from "./users/manage-users/manage-users.component";
import {ManageUsersListComponent} from "./users/manage-users-list/manage-users-list.component";
import {ManageUsersAddComponent} from "./users/manage-users-add/manage-users-add.component";
import {ManageUsersEditComponent} from "./users/manage-users-edit/manage-users-edit.component";
import {SharedModule} from "../shared/shared.module";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
-import { ManageUsersDeleteComponent } from './users/manage-users-delete/manage-users-delete.component';
-
+import {ManageUsersDeleteComponent} from './users/manage-users-delete/manage-users-delete.component';
+import {UserRoutingModule} from "./user-routing.module";
@NgModule({
- declarations: [
- ManageUsersComponent,
- ManageUsersListComponent,
- ManageUsersAddComponent,
- ManageUsersEditComponent,
- ManageUsersDeleteComponent
- ],
- exports: [
- ManageUsersComponent,
- ManageUsersListComponent,
- ManageUsersAddComponent,
- ManageUsersEditComponent
- ],
- imports: [
- CommonModule,
- SharedModule,
- FormsModule,
- ReactiveFormsModule
- ]
+ declarations: [
+ ManageUsersComponent,
+ ManageUsersListComponent,
+ ManageUsersAddComponent,
+ ManageUsersEditComponent,
+ ManageUsersDeleteComponent
+ ],
+ exports: [
+ ManageUsersComponent,
+ ManageUsersListComponent,
+ ManageUsersAddComponent,
+ ManageUsersEditComponent
+ ],
+ imports: [
+ CommonModule,
+ UserRoutingModule,
+ SharedModule,
+ FormsModule,
+ ReactiveFormsModule
+ ]
})
-export class UserModule { }
+export class UserModule {
+}