mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-13 17:35:12 +00:00
fix: move org create into parent routing module (#2765)
This commit is contained in:
@@ -4,154 +4,157 @@ import { QuicklinkStrategy } from 'ngx-quicklink';
|
||||
|
||||
import { AuthGuard } from './guards/auth.guard';
|
||||
import { RoleGuard } from './guards/role.guard';
|
||||
import { OrgCreateComponent } from './pages/org-create/org-create.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./pages/home/home.module').then(m => m.HomeModule),
|
||||
canActivate: [AuthGuard],
|
||||
},
|
||||
{
|
||||
path: 'firststeps',
|
||||
loadChildren: () => import('./modules/onboarding/onboarding.module')
|
||||
.then(m => m.OnboardingModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['iam.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'granted-projects',
|
||||
loadChildren: () => import('./pages/projects/granted-projects/granted-projects.module')
|
||||
.then(m => m.GrantedProjectsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['project.grant.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'projects',
|
||||
loadChildren: () => import('./pages/projects/owned-projects/owned-projects.module')
|
||||
.then(m => m.OwnedProjectsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['project.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'users',
|
||||
canActivate: [AuthGuard],
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
loadChildren: () => import('src/app/pages/users/user-list/user-list.module')
|
||||
.then(m => m.UserListModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('src/app/pages/users/user-detail/user-detail.module')
|
||||
.then(m => m.UserDetailModule),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'iam',
|
||||
loadChildren: () => import('./pages/iam/iam.module').then(m => m.IamModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['iam.read', 'iam.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'org',
|
||||
loadChildren: () => import('./pages/orgs/orgs.module').then(m => m.OrgsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['org.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'actions',
|
||||
loadChildren: () => import('./pages/actions/actions.module').then(m => m.ActionsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['org.read'],
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./pages/home/home.module').then((m) => m.HomeModule),
|
||||
canActivate: [AuthGuard],
|
||||
},
|
||||
{
|
||||
path: 'grants',
|
||||
loadChildren: () => import('./pages/grants/grants.module').then(m => m.GrantsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
{
|
||||
path: 'firststeps',
|
||||
loadChildren: () => import('./modules/onboarding/onboarding.module').then((m) => m.OnboardingModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['iam.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'granted-projects',
|
||||
loadChildren: () =>
|
||||
import('./pages/projects/granted-projects/granted-projects.module').then((m) => m.GrantedProjectsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['project.grant.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'projects',
|
||||
loadChildren: () => import('./pages/projects/owned-projects/owned-projects.module').then((m) => m.OwnedProjectsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['project.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'users',
|
||||
canActivate: [AuthGuard],
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
loadChildren: () => import('src/app/pages/users/user-list/user-list.module').then((m) => m.UserListModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.read'],
|
||||
roles: ['user.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('src/app/pages/users/user-detail/user-detail.module').then((m) => m.UserDetailModule),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'iam',
|
||||
loadChildren: () => import('./pages/iam/iam.module').then((m) => m.IamModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['iam.read', 'iam.write'],
|
||||
},
|
||||
{
|
||||
path: 'grant-create',
|
||||
canActivate: [AuthGuard],
|
||||
children: [
|
||||
{
|
||||
path: 'project/:projectid/grant/:grantid',
|
||||
loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module')
|
||||
.then(m => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'project/:projectid',
|
||||
loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module')
|
||||
.then(m => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'user/:userid',
|
||||
loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module')
|
||||
.then(m => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module')
|
||||
.then(m => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'org',
|
||||
loadChildren: () => import('./pages/orgs/orgs.module').then((m) => m.OrgsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['org.read'],
|
||||
},
|
||||
{
|
||||
path: 'signedout',
|
||||
loadChildren: () => import('./pages/signedout/signedout.module').then(m => m.SignedoutModule),
|
||||
},
|
||||
{
|
||||
path: 'org/create',
|
||||
component: OrgCreateComponent,
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['(org.create)?(iam.write)?'],
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: '/',
|
||||
loadChildren: () => import('./pages/org-create/org-create.module').then((m) => m.OrgCreateModule),
|
||||
},
|
||||
{
|
||||
path: 'actions',
|
||||
loadChildren: () => import('./pages/actions/actions.module').then((m) => m.ActionsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['org.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'grants',
|
||||
loadChildren: () => import('./pages/grants/grants.module').then((m) => m.GrantsModule),
|
||||
canActivate: [AuthGuard, RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.read'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'grant-create',
|
||||
canActivate: [AuthGuard],
|
||||
children: [
|
||||
{
|
||||
path: 'project/:projectid/grant/:grantid',
|
||||
loadChildren: () =>
|
||||
import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'project/:projectid',
|
||||
loadChildren: () =>
|
||||
import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'user/:userid',
|
||||
loadChildren: () =>
|
||||
import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () =>
|
||||
import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule),
|
||||
canActivate: [RoleGuard],
|
||||
data: {
|
||||
roles: ['user.grant.write'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'signedout',
|
||||
loadChildren: () => import('./pages/signedout/signedout.module').then((m) => m.SignedoutModule),
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: '/',
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(
|
||||
routes,
|
||||
{
|
||||
preloadingStrategy: QuicklinkStrategy,
|
||||
relativeLinkResolution: 'legacy',
|
||||
},
|
||||
),
|
||||
],
|
||||
exports: [RouterModule],
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, {
|
||||
preloadingStrategy: QuicklinkStrategy,
|
||||
relativeLinkResolution: 'legacy',
|
||||
}),
|
||||
],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
export class AppRoutingModule {}
|
||||
|
||||
Reference in New Issue
Block a user