diff --git a/npm/ng-packs/packages/identity/config/src/providers/index.ts b/npm/ng-packs/packages/identity/config/src/providers/index.ts new file mode 100644 index 0000000000..fe08efba8c --- /dev/null +++ b/npm/ng-packs/packages/identity/config/src/providers/index.ts @@ -0,0 +1 @@ +export * from './route.provider'; diff --git a/npm/ng-packs/packages/identity/config/src/providers/route.provider.ts b/npm/ng-packs/packages/identity/config/src/providers/route.provider.ts new file mode 100644 index 0000000000..3f88c68464 --- /dev/null +++ b/npm/ng-packs/packages/identity/config/src/providers/route.provider.ts @@ -0,0 +1,37 @@ +import { eLayoutType, RoutesService } from '@abp/ng.core'; +import { eThemeSharedRouteNames } from '@abp/ng.theme.shared'; +import { APP_INITIALIZER } from '@angular/core'; +import { eIdentityRouteNames } from '../enums/route-names'; + +export const IDENTITY_ROUTE_PROVIDERS = [ + { provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true }, +]; + +export function configureRoutes(routes: RoutesService) { + return () => { + routes.add([ + { + path: '/identity', + name: eIdentityRouteNames.IdentityManagement, + parentName: eThemeSharedRouteNames.Administration, + iconClass: 'fa fa-id-card-o', + layout: eLayoutType.application, + order: 1, + }, + { + path: '/identity/roles', + name: eIdentityRouteNames.Roles, + parentName: eIdentityRouteNames.IdentityManagement, + requiredPolicy: 'AbpIdentity.Roles', + order: 1, + }, + { + path: '/identity/users', + name: eIdentityRouteNames.Users, + parentName: eIdentityRouteNames.IdentityManagement, + requiredPolicy: 'AbpIdentity.Users', + order: 2, + }, + ]); + }; +}