2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
18 import {NgModule} from '@angular/core';
19 import {RouterModule, Routes} from '@angular/router';
20 import {RoutingGuardService as Guard} from "@app/services/routing-guard.service";
21 import {ManageRolesComponent} from "@app/modules/security/roles/manage-roles/manage-roles.component";
22 import {ManageRolesListComponent} from "@app/modules/security/roles/manage-roles-list/manage-roles-list.component";
23 import {ManageRolesEditComponent} from "@app/modules/security/roles/manage-roles-edit/manage-roles-edit.component";
27 * You can use Guard (RoutingGuardService) for permission checking. The service needs data with one parameter 'perm',
28 * that gives the path of the uiPermission map of the user service.
31 const routes: Routes = [
33 path: '', component: ManageRolesComponent, canActivate: [Guard],
34 data: {perm: 'menu.user.roles'},
36 {path: 'list', component: ManageRolesListComponent},
37 {path: 'edit/:roleid', component: ManageRolesEditComponent},
38 {path: '', redirectTo: 'list', pathMatch: 'full'}
44 imports: [RouterModule.forChild(routes)],
48 export class RoleRoutingModule {