diff --git a/frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 6f3024af5..45186f40b 100644 --- a/frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -334,6 +334,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn [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.InvitePlanUsers].join('.'), + [nameof(x => x.description), nameof(x => x.authorizationFlags), AppPermission.CloneDescription].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('.'), diff --git a/frontend/src/app/ui/description/listing/description-listing.component.ts b/frontend/src/app/ui/description/listing/description-listing.component.ts index 22406ed03..418636a40 100644 --- a/frontend/src/app/ui/description/listing/description-listing.component.ts +++ b/frontend/src/app/ui/description/listing/description-listing.component.ts @@ -507,6 +507,7 @@ export class DescriptionListingComponent extends BaseListingComponent(x => x.authorizationFlags), AppPermission.EditDescription].join('.'), [nameof(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'), [nameof(x => x.authorizationFlags), AppPermission.InvitePlanUsers].join('.'), + [nameof(x => x.authorizationFlags), AppPermission.CloneDescription].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.id)].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.label)].join('.'), diff --git a/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html b/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html index db5efb0cc..72d06f2ca 100644 --- a/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html +++ b/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html @@ -38,7 +38,7 @@ diff --git a/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts b/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts index 8a3d255d6..a52a0cd42 100644 --- a/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts +++ b/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts @@ -53,6 +53,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On planAccessTypeEnum = PlanAccessType; canDelete: boolean = false; canEdit: boolean = false; + canCopy: boolean = false; canInvitePlanUsers: boolean = false; canExport: boolean = false; @@ -103,6 +104,8 @@ export class DescriptionListingItemComponent extends BaseComponent implements On this.canExport = this.description.authorizationFlags?.some(x => x === AppPermission.ExportDescription) || this.authentication.hasPermission(AppPermission.ExportDescription) && !this.isDeleted && this.description.status?.definition?.availableActions?.filter(x => x === DescriptionStatusAvailableActionType.Export).length > 0; + + this.canCopy = (this.authentication.hasPermission(AppPermission.PublicCloneDescription) && this.isPublic) || (this.description.authorizationFlags?.some(x => x === AppPermission.CloneDescription) && !this.isDeleted && this.description.belongsToCurrentTenant != false); } public getTenantName(id: Guid): string { diff --git a/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts b/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts index b322baba2..fffd70064 100644 --- a/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts +++ b/frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts @@ -66,7 +66,12 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { } get canClonePlan(): boolean { - return this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan) || (this.authentication.hasPermission(AppPermission.PublicClonePlan)) && !this.isDeleted; + const authorizationFlags = !this.isPublic ? (this.plan as Plan).authorizationFlags : []; + return ( + authorizationFlags?.some(x => x === AppPermission.ClonePlan) || + this.authentication.hasPermission(AppPermission.ClonePlan) || + (this.authentication.hasPermission(AppPermission.PublicClonePlan) && this.isPublic) + ); } get canFinalizePlan(): boolean {