PeerTube/client/src/app/+admin/users/users.routes.ts

55 lines
1.2 KiB
TypeScript
Raw Normal View History

import { Routes } from '@angular/router'
2020-06-23 14:10:17 +02:00
import { ServerConfigResolver, UserRightGuard } from '@app/core'
import { UserRight } from '@shared/models'
2018-05-09 15:30:37 +02:00
import { UserCreateComponent, UserUpdateComponent } from './user-edit'
import { UserListComponent } from './user-list'
2020-06-23 14:10:17 +02:00
import { UsersComponent } from './users.component'
2016-08-09 21:45:21 +02:00
2016-09-06 22:40:57 +02:00
export const UsersRoutes: Routes = [
2016-08-09 21:45:21 +02:00
{
2017-05-05 16:08:43 +02:00
path: 'users',
component: UsersComponent,
canActivate: [ UserRightGuard ],
data: {
userRight: UserRight.MANAGE_USERS
},
2017-05-05 16:08:43 +02:00
children: [
{
path: '',
redirectTo: 'list',
pathMatch: 'full'
},
{
path: 'list',
component: UserListComponent,
data: {
meta: {
title: 'Users list'
2016-11-04 17:25:26 +01:00
}
2017-05-05 16:08:43 +02:00
}
},
{
2018-05-09 15:30:37 +02:00
path: 'create',
component: UserCreateComponent,
2017-05-05 16:08:43 +02:00
data: {
meta: {
2018-05-09 15:30:37 +02:00
title: 'Create a user'
2016-11-04 17:25:26 +01:00
}
},
resolve: {
serverConfig: ServerConfigResolver
2016-08-09 21:45:21 +02:00
}
2017-09-05 21:29:39 +02:00
},
{
2018-05-09 15:37:52 +02:00
path: 'update/:id',
2017-09-05 21:29:39 +02:00
component: UserUpdateComponent,
data: {
meta: {
title: 'Update a user'
}
}
2017-05-05 16:08:43 +02:00
}
]
}
]