]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/users/users.routes.ts
Support roles with rights and add moderator role
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / users / users.routes.ts
index 723c5715d9baff8d855beb678bfcb1c2306c4d61..3718dfd5cd178817ba259dda35121ead96d7e29a 100644 (file)
@@ -1,13 +1,19 @@
 import { Routes } from '@angular/router'
 
+import { UserRightGuard } from '../../core'
+import { UserRight } from '../../../../../shared'
 import { UsersComponent } from './users.component'
-import { UserAddComponent } from './user-add'
+import { UserAddComponent, UserUpdateComponent } from './user-edit'
 import { UserListComponent } from './user-list'
 
 export const UsersRoutes: Routes = [
   {
     path: 'users',
     component: UsersComponent,
+    canActivate: [ UserRightGuard ],
+    data: {
+      userRight: UserRight.MANAGE_USERS
+    },
     children: [
       {
         path: '',
@@ -31,6 +37,15 @@ export const UsersRoutes: Routes = [
             title: 'Add a user'
           }
         }
+      },
+      {
+        path: ':id/update',
+        component: UserUpdateComponent,
+        data: {
+          meta: {
+            title: 'Update a user'
+          }
+        }
       }
     ]
   }