X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fusers%2Fusers.routes.ts;h=8b3791bd3fb21bc16dbc25132721b97e159874f7;hb=88108880bbdba473cfe36ecbebc1c3c4f972e102;hp=ac64c891fd8e9526bec495007dbe8b0351d3b1a9;hpb=55b3394641a764b89132d0057d3fdf656dab2389;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts index ac64c891f..8b3791bd3 100644 --- a/client/src/app/+admin/users/users.routes.ts +++ b/client/src/app/+admin/users/users.routes.ts @@ -1,37 +1,52 @@ -import { Routes } from '@angular/router'; +import { Routes } from '@angular/router' -import { UsersComponent } from './users.component'; -import { UserAddComponent } from './user-add'; -import { UserListComponent } from './user-list'; +import { UserRightGuard } from '../../core' +import { UserRight } from '../../../../../shared' +import { UsersComponent } from './users.component' +import { UserCreateComponent, UserUpdateComponent } from './user-edit' +import { UserListComponent } from './user-list' export const UsersRoutes: Routes = [ { - path: 'users', - component: UsersComponent, - children: [ - { - path: '', - redirectTo: 'list', - pathMatch: 'full' - }, - { - path: 'list', - component: UserListComponent, - data: { - meta: { - title: 'Users list' - } + path: 'users', + component: UsersComponent, + canActivate: [ UserRightGuard ], + data: { + userRight: UserRight.MANAGE_USERS + }, + children: [ + { + path: '', + redirectTo: 'list', + pathMatch: 'full' + }, + { + path: 'list', + component: UserListComponent, + data: { + meta: { + title: 'Users list' } - }, - { - path: 'add', - component: UserAddComponent, - data: { - meta: { - title: 'Add a user' - } + } + }, + { + path: 'create', + component: UserCreateComponent, + data: { + meta: { + title: 'Create a user' + } + } + }, + { + path: 'update/:id', + component: UserUpdateComponent, + data: { + meta: { + title: 'Update a user' } } - ] - } -]; + } + ] + } +]