added planstatus permissions and routing structure
This commit is contained in:
parent
b8a8806220
commit
2a288b981c
|
@ -245,5 +245,6 @@ public final class Permission {
|
|||
public static String ViewMineInAppNotificationPage = "ViewMineInAppNotificationPage";
|
||||
public static String ViewTenantConfigurationPage = "ViewTenantConfigurationPage";
|
||||
public static String ViewStatusPage = "ViewStatusPage";
|
||||
public static String ViewPlanStatusPage = "ViewPlanStatusPage";
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.opencdmp.service.tag.TagServiceImpl;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.management.InvalidApplicationException;
|
||||
import java.time.Instant;
|
||||
|
@ -41,6 +42,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class PlanStatusServiceImpl implements PlanStatusService {
|
||||
|
||||
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(PlanStatusServiceImpl.class));
|
||||
|
|
|
@ -115,6 +115,31 @@ permissions:
|
|||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
|
||||
#PlanStatus
|
||||
BrowsePlanStatus:
|
||||
roles: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
EditPlanStatus:
|
||||
roles:
|
||||
- Admin
|
||||
- TenantAdmin
|
||||
- TenantConfigManager
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
DeletePlanStatus:
|
||||
roles:
|
||||
- Admin
|
||||
- TenantAdmin
|
||||
- TenantConfigManager
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
|
||||
# NotificationTemplate
|
||||
BrowseNotificationTemplate:
|
||||
roles: [ ]
|
||||
|
@ -1295,3 +1320,11 @@ permissions:
|
|||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
ViewPlanStatusPage:
|
||||
roles:
|
||||
- Admin
|
||||
- TenantAdmin
|
||||
- TenantConfigManager
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
|
@ -396,6 +396,15 @@ const appRoutes: Routes = [
|
|||
})
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'plan-statuses',
|
||||
loadChildren: () => import('./ui/admin/plan-status/plan-status.module').then(m => m.PlanStatusModule),
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.ViewMaintenancePage]
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
loadChildren: () => import('./ui/auth/login/login.module').then(m => m.LoginModule),
|
||||
|
@ -436,4 +445,3 @@ const tenantEnrichedRoutes: Routes = [
|
|||
exports: [RouterModule],
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
|
|
|
@ -85,6 +85,11 @@ export enum AppPermission {
|
|||
InvitePlanUsers = "InvitePlanUsers",
|
||||
AnnotatePlan = "AnnotatePlan",
|
||||
|
||||
//PlanStatus
|
||||
BrowsePlanStatus = "BrowsePlanStatus",
|
||||
EditPlanStatus = "EditPlanStatus",
|
||||
DeletePlanStatus = "DeletePlanStatus",
|
||||
|
||||
//PlanBlueprint
|
||||
BrowsePlanBlueprint = "BrowsePlanBlueprint",
|
||||
EditPlanBlueprint = "EditPlanBlueprint",
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import { NgModule } from "@angular/core";
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { PlanStatusRoutingModule } from "./plan-status.routing";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
PlanStatusRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
]
|
||||
})
|
||||
export class PlanStatusModule { }
|
|
@ -0,0 +1,54 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { AuthGuard } from '@app/core/auth-guard.service';
|
||||
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
// component:,
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
canActivate: [AuthGuard],
|
||||
// component:,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditPlanStatus]
|
||||
},
|
||||
...BreadcrumbService.generateRouteDataConfiguration({
|
||||
title: 'BREADCRUMBS.NEW-LANGUAGE'
|
||||
}),
|
||||
getFromTitleService: true,
|
||||
usePrefix: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
canActivate: [AuthGuard],
|
||||
// component:,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
// resolve: {
|
||||
// 'entity':
|
||||
// },
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.EditPlanStatus]
|
||||
},
|
||||
getFromTitleService: true,
|
||||
usePrefix: false
|
||||
}
|
||||
|
||||
},
|
||||
{ path: '**', loadChildren: () => import('@common/modules/page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class PlanStatusRoutingModule { }
|
Loading…
Reference in New Issue