X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fusers%2Fusers.routes.ts;h=460ebd89e8f09dff05ffb0914bb3e547f53ced29;hb=328c78bc4a570a9aceaaa1a2124bacd4a0e8d295;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..460ebd89e 100644 --- a/client/src/app/+admin/users/users.routes.ts +++ b/client/src/app/+admin/users/users.routes.ts @@ -1,37 +1,53 @@ -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' + }, + isAdministration: true + } + } + ] + } +]