From 2e7606a4976ae659565e75ab745ca1aad4838e68 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 28 Mar 2024 13:10:51 +0200 Subject: [PATCH 1/5] apply authz flags to dashboard --- .../ui/dashboard/drafts/drafts.component.html | 4 ++-- .../ui/dashboard/drafts/drafts.component.ts | 21 +++++++++++++++++++ .../recent-edited-activity.component.html | 4 ++-- .../recent-edited-activity.component.ts | 21 +++++++++++++++++++ ...edited-description-activity.component.html | 2 +- ...t-edited-description-activity.component.ts | 9 ++++++++ .../recent-edited-dmp-activity.component.html | 2 +- .../recent-edited-dmp-activity.component.ts | 14 +++++++++++++ 8 files changed, 71 insertions(+), 6 deletions(-) diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html index c80edb200..5c35bdd72 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html @@ -24,8 +24,8 @@
- - + +
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}} diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts index c39e08b43..496612988 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts @@ -22,6 +22,8 @@ import { ReferenceType } from '@app/core/model/reference-type/reference-type'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { IsActive } from '@app/core/common/enum/is-active.enum'; +import { AppPermission } from '@app/core/common/enum/permission.enum'; +import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint'; @Component({ selector: 'app-drafts', @@ -135,10 +137,22 @@ export class DraftsComponent extends BaseComponent implements OnInit { [nameof(x => x.dmp), nameof(x => x.groupId)].join('.'), [nameof(x => x.dmp), nameof(x => x.updatedAt)].join('.'), [nameof(x => x.dmp), nameof(x => x.isActive)].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.EditDmp].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.id)].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.label)].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.status)].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.isActive)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.id)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.label)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.id)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.label)].join('.'), [nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.id)].join('.'), [nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.user.id)].join('.'), [nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.role)].join('.'), @@ -154,12 +168,19 @@ export class DraftsComponent extends BaseComponent implements OnInit { [nameof(x => x.description), nameof(x => x.status)].join('.'), [nameof(x => x.description), nameof(x => x.updatedAt)].join('.'), [nameof(x => x.description), nameof(x => x.isActive)].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.EditDescription].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.groupId)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.accessType)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.id)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.label)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.id)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.user.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.role)].join('.'), diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index a2d00d6f9..66343068a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -26,8 +26,8 @@
- - + +
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 3fe14e807..240bed9d1 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -5,10 +5,12 @@ import { ActivatedRoute, Router } from '@angular/router'; import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { IsActive } from '@app/core/common/enum/is-active.enum'; +import { AppPermission } from '@app/core/common/enum/permission.enum'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { RecentActivityItem } from '@app/core/model/dashboard/recent-activity-item'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { Description } from '@app/core/model/description/description'; +import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint'; import { Dmp, DmpUser } from '@app/core/model/dmp/dmp'; import { DmpReference } from '@app/core/model/dmp/dmp-reference'; import { ReferenceType } from '@app/core/model/reference-type/reference-type'; @@ -134,10 +136,22 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn [nameof(x => x.dmp), nameof(x => x.groupId)].join('.'), [nameof(x => x.dmp), nameof(x => x.updatedAt)].join('.'), [nameof(x => x.dmp), nameof(x => x.isActive)].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'), + [nameof(x => x.dmp), nameof(x => x.authorizationFlags), AppPermission.EditDmp].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.id)].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.label)].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.status)].join('.'), [nameof(x => x.dmp), nameof(x => x.descriptions), nameof(x => x.isActive)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.id)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.label)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.id)].join('.'), + [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.label)].join('.'), [nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.id)].join('.'), [nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.user.id)].join('.'), [nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.role)].join('.'), @@ -153,12 +167,19 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn [nameof(x => x.description), nameof(x => x.status)].join('.'), [nameof(x => x.description), nameof(x => x.updatedAt)].join('.'), [nameof(x => x.description), nameof(x => x.isActive)].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.EditDescription].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.groupId)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.accessType)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.id)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.label)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.id)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.user.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.role)].join('.'), diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.html index 27d97e860..62c190f78 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.html @@ -24,7 +24,7 @@
- +
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.ts index 2899bda5d..f1f569041 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-description-activity/recent-edited-description-activity.component.ts @@ -19,6 +19,8 @@ import { BaseComponent } from '@common/base/base.component'; import { debounceTime, takeUntil } from 'rxjs/operators'; import { nameof } from 'ts-simple-nameof'; import { DescriptionStatus } from '@app/core/common/enum/description-status'; +import { AppPermission } from '@app/core/common/enum/permission.enum'; +import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint'; @Component({ selector: 'app-recent-edited-description-activity', @@ -129,12 +131,19 @@ export class RecentEditedDescriptionActivityComponent extends BaseComponent impl [nameof(x => x.description), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.status)].join('.'), [nameof(x => x.description), nameof(x => x.updatedAt)].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.EditDescription].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.descriptionTemplate), nameof(x => x.groupId)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.accessType)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.id)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.label)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.id)].join('.'), + [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.label)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.user.id)].join('.'), [nameof(x => x.description), nameof(x => x.dmp), nameof(x => x.dmpUsers), nameof(x => x.role)].join('.'), diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html index 1690310d3..169d2f49d 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html @@ -24,7 +24,7 @@
- +