Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ plugins {
id 'org.flywaydb.flyway' version "$flywayVersion"
id 'org.sonarqube' version '7.3.1.8318'
id 'net.serenity-bdd.serenity-gradle-plugin' version "$serenityBddVersion"
id 'hmcts.ccd.sdk' version '6.13.0'
id 'com.github.hmcts.rse-cft-lib' version '0.19.2220'
id 'hmcts.ccd.sdk' version 'noc-xui-native-alpha-20260707-71e09a0'
id 'com.github.hmcts.rse-cft-lib' version '0.19.2230'
id 'io.freefair.lombok' version '9.5.0'
id 'au.com.dius.pact' version '4.7.3'
id "com.avast.gradle.docker-compose" version "0.17.21"
Expand Down Expand Up @@ -565,8 +565,10 @@ tasks.withType(CftlibExec).configureEach {
environment 'XUI_JURISDICTIONS', 'PCS'
environment 'XUI_DOCUMENTS_API_V2', 'http://ccd-case-document-am-api-aat.service.core-compute-aat.internal'
environment 'CASE_DOCUMENT_S2S_AUTHORISED_SERVICES', 'ccd_case_document_am_api,ccd_gw,xui_webapp,ccd_data,pcs_frontend,pcs_api'
environment 'DATA_STORE_S2S_AUTHORISED_SERVICES', 'ccd_data,ccd_gw,pcs_frontend,pcs_api'
environment 'DATA_STORE_S2S_AUTHORISED_SERVICES', 'ccd_data,ccd_gw,pcs_frontend,pcs_api, aac_manage_case_assignment'
environment 'CCD_S2S-AUTHORISED_SERVICES_CASE_USER_ROLES', 'aac_manage_case_assignment,pcs_api'
environment 'RSE_LIB_XUI_ENV_DECENTRALISED_CASE_TYPE_CONFIG', '{ \'PCS\': {\'webUrl\': \'https://pcs-frontend.service.gov.uk\',\'nocBaseUrl\': \'http://host.docker.internal:3206\'} }'
environment 'XUI_MANAGE_CASES_TAG', 'pr-5293-90d9b99-20260709110945'
}

tasks.register('highLevelDataSetup', JavaExec) {
Expand Down
2 changes: 1 addition & 1 deletion charts/pcs-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: "1.0"
description: A Helm chart for pcs-api App
name: pcs-api
home: https://github.com/hmcts/pcs-api
version: 0.0.73
version: 0.0.74
maintainers:
- name: HMCTS pcs team
dependencies:
Expand Down
6 changes: 4 additions & 2 deletions charts/pcs-api/values.ccd.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ ccd:
ELASTIC_SEARCH_ENABLED: true
ELASTIC_SEARCH_DATA_NODES_HOSTS: "http://{{ .Release.Name }}-es-master:9200"
ELASTIC_SEARCH_HOSTS: "http://{{ .Release.Name }}-es-master:9200"
CCD_S2S_AUTHORISED_SERVICES_CASE_USER_ROLES: "aac_manage_case_assignment,pcs_api,pcs_frontend"
CCD_S2S_AUTHORISED_SERVICES_CASE_USER_ROLES: "aac_manage_case_assignment,pcs_api,pcs_frontend,xui_webapp"
CASE_DOCUMENT_AM_URL: http://${SERVICE_NAME}-cdam
ingressHost: ccd-data-store-api-${SERVICE_FQDN}
autoscaling:
Expand Down Expand Up @@ -177,7 +177,7 @@ xui-webapp:
nodejs:
imagePullPolicy: Always
releaseNameOverride: ${SERVICE_NAME}-xui-webapp
image: hmctsprod.azurecr.io/xui/webapp:latest
image: hmctsprod.azurecr.io/xui/webapp:pr-5293-90d9b99-20260709110945
ingressHost: xui-${SERVICE_FQDN}
devmemoryRequests: 2Gi
devcpuRequests: 500m
Expand Down Expand Up @@ -211,6 +211,8 @@ xui-webapp:
{"service":"CIVIL","serviceCodes":["AAA6","AAA7"]},
{"service":"SSCS","serviceCodes":["BBA3"]},
{"service":"PCS","serviceCodes":["AAA3"]}]
DECENTRALISED_CASE_TYPE_CONFIG: >-
{"PCS": {"nocBaseUrl": "https://${SERVICE_NAME}.preview.platform.hmcts.net"}}
keyVaults:
rpx:
resourceGroup: rpx
Expand Down
2 changes: 2 additions & 0 deletions charts/pcs-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ java:
CCD_DATA_STORE_URL: "http://ccd-data-store-api-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal"
CASE_DOCUMENT_AM_URL: "http://ccd-case-document-am-api-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal"
RD_PROFESSIONAL_API_URL: "http://rd-professional-api-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal"
RSE_LIB_XUI_ENV_DECENTRALISED_CASE_TYPE_CONFIG: >-
{"PCS": {"nocBaseUrl": "http://pcs-api-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal"}}
servicebus:
enabled: false
ccd:
Expand Down
8 changes: 6 additions & 2 deletions src/cftlib/java/uk/gov/hmcts/reform/pcs/CftlibConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ public void configure(CFTLib lib) throws Exception {
var users = Map.of(
"caseworker@pcs.com", List.of("caseworker", "caseworker-pcs"),
"pcs-solicitor1@test.com", List.of("caseworker", "caseworker-pcs-solicitor"),
"pcs-defendant-solicitor@test.com", List.of("pui-case-manager", "caseworker", "caseworker-pcs-solicitor"),
"pcs-defendant-solicitor@test.com", List.of("pui-case-manager", "caseworker",
"caseworker-pcs-solicitor", "caseworker-pcs"),
"citizen@pcs.com", List.of("citizen"),
"data.store.idam.system.user@gmail.com", List.of(),
"ccd.import@pcs.com", List.of("ccd-import"),
"pcs-system-user@localhost", List.of("caseworker", "caseworker-pcs", "ccd-import", "pcs-system-update"),
"prd-admin-user@localhost", List.of()
"prd-admin-user@localhost", List.of(),
"master.caa@gmail.com", List.of("caseworker-caa")
);

// Create users and roles including in idam simulator
Expand All @@ -73,6 +75,8 @@ private void createAccessProfiles(CFTLib lib) {
roleNames.add("caseworker");
roleNames.add("caseworker-ras-validation");
roleNames.add("GS_profile");
roleNames.add("pui-case-manager");
roleNames.add("caseworker-caa");

lib.createRoles(roleNames.toArray(new String[0]));
}
Expand Down
10 changes: 10 additions & 0 deletions src/cftlib/resources/cftlib-am-role-assignments.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
"attributes": {
},
"authorisations": []
},
{
"roleType": "CASE",
"roleName": "idam:caseworker-pcs-solicitor",
"grantType": "SPECIFIC",
"roleCategory": "PROFESSIONAL",
"classification": "RESTRICTED",
"readOnly": false,
"attributes": { "caseType": "PCS", "jurisdiction": "PCS" },
"authorisations": []
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package uk.gov.hmcts.reform.pcs.ccd.accesscontrol;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.SetMultimap;
import uk.gov.hmcts.ccd.sdk.api.HasAccessControl;
import uk.gov.hmcts.ccd.sdk.api.HasRole;
import uk.gov.hmcts.ccd.sdk.api.Permission;

import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.ORGANISATION_CASE_ACCESS_ADMINISTRATOR;


public class AcaSystemUserAccess implements HasAccessControl {

@Override
public SetMultimap<HasRole, Permission> getGrants() {
SetMultimap<HasRole, Permission> grants = HashMultimap.create();
grants.putAll(ORGANISATION_CASE_ACCESS_ADMINISTRATOR, Permission.CRUD);
return grants;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public enum AccessProfile implements HasRole {
WLU_TEAM_LEADER("wlu-team-leader", Permission.CRU),
WLU_ADMIN("wlu-admin", Permission.CRU),
GS_PROFILE("GS_profile", Set.of(R)),
SYSTEM_USER("pcs-system-update", CRU);
SYSTEM_USER("pcs-system-update", CRU),
ORGANISATION_CASE_ACCESS_ADMINISTRATOR("caseworker-caa", CRU);


@JsonValue
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package uk.gov.hmcts.reform.pcs.ccd.accesscontrol;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Getter;
import uk.gov.hmcts.ccd.sdk.api.HasRole;
import uk.gov.hmcts.ccd.sdk.type.DynamicListItem;

import java.util.List;

@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
@Getter
public class CaseRoleID implements HasRole {

@JsonProperty("value")
private DynamicListItem value;

@JsonProperty("list_items")
private List<DynamicListItem> listItems;

public String getRole() {
return value.getCode().toString();
}

public String getCaseTypePermissions() {
return value.getLabel().toString();
}

public CaseRoleID(@JsonProperty("value") DynamicListItem value,
@JsonProperty("list_items") List<DynamicListItem> listItems) {
this.value = value;
this.listItems = listItems;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import uk.gov.hmcts.ccd.sdk.api.HasRole;
import uk.gov.hmcts.ccd.sdk.api.Permission;

import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.ORGANISATION_CASE_ACCESS_ADMINISTRATOR;
import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.PCS_SOLICITOR;


Expand All @@ -15,6 +16,7 @@ public class ClaimantAccess implements HasAccessControl {
public SetMultimap<HasRole, Permission> getGrants() {
SetMultimap<HasRole, Permission> grants = HashMultimap.create();
grants.putAll(PCS_SOLICITOR, Permission.CRU);
grants.putAll(ORGANISATION_CASE_ACCESS_ADMINISTRATOR, Permission.CRU);
return grants;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package uk.gov.hmcts.reform.pcs.ccd.accesscontrol;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.SetMultimap;
import uk.gov.hmcts.ccd.sdk.api.HasAccessControl;
import uk.gov.hmcts.ccd.sdk.api.HasRole;
import uk.gov.hmcts.ccd.sdk.api.Permission;

import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.CIRCUIT_JUDGE;
import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.CTSC_ADMIN;
import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.FEE_PAID_JUDGE;
import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.HEARING_CENTRE_ADMIN;
import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.JUDGE;
import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.LEADERSHIP_JUDGE;
import static uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole.WLU_ADMIN;


public class OrganisationPolicyAccess implements HasAccessControl {

@Override
public SetMultimap<HasRole, Permission> getGrants() {
SetMultimap<HasRole, Permission> grants = HashMultimap.create();
grants.putAll(CTSC_ADMIN, Permission.CRU);
grants.putAll(HEARING_CENTRE_ADMIN, Permission.CRU);
grants.putAll(WLU_ADMIN, Permission.CRU);
grants.put(FEE_PAID_JUDGE, Permission.R);
grants.put(CIRCUIT_JUDGE, Permission.R);
grants.put(LEADERSHIP_JUDGE, Permission.R);
grants.put(JUDGE, Permission.R);

return grants;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public enum UserRole implements HasRole {
LEADERSHIP_JUDGE("leadership-judge", Set.of(R), RAS),
CIRCUIT_JUDGE("circuit-judge", Set.of(R), RAS),
JUDGE("judge", Set.of(R), RAS),
SYSTEM_USER("pcs-system-update", Permission.CRU, IDAM);

SYSTEM_USER("pcs-system-update", Permission.CRU, IDAM),
ORGANISATION_CASE_ACCESS_ADMINISTRATOR("caseworker-caa", Permission.CRU, IDAM);

@JsonValue
private final String role;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public class HighLevelDataSetupApp extends DataLoaderToDefinitionStore {
new CcdRoleConfig("fee-paid-judge", "PUBLIC"),
new CcdRoleConfig("circuit-judge", "PUBLIC"),
new CcdRoleConfig("leadership-judge", "PUBLIC"),
new CcdRoleConfig("pcs-system-update", "PUBLIC")
new CcdRoleConfig("pcs-system-update", "PUBLIC"),
new CcdRoleConfig("caseworker-caa", "PUBLIC"),
new CcdRoleConfig("pui-case-manager", "PUBLIC")
};


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package uk.gov.hmcts.reform.pcs.ccd.domain;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Set;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import uk.gov.hmcts.ccd.sdk.api.ComplexType;
import uk.gov.hmcts.ccd.sdk.api.HasRole;
import uk.gov.hmcts.ccd.sdk.type.Organisation;
import uk.gov.hmcts.ccd.sdk.type.PreviousOrganisationCollectionItem;
import uk.gov.hmcts.ccd.sdk.type.YesOrNo;

@NoArgsConstructor
@Builder
@Data
@ComplexType(name = "OrganisationPolicy", generate = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrganisationPolicy<R extends HasRole> {

@JsonProperty("Organisation")
private Organisation organisation;

@JsonProperty("PreviousOrganisations")
private Set<PreviousOrganisationCollectionItem> previousOrganisations;

@JsonProperty("OrgPolicyReference")
private String orgPolicyReference;

@JsonProperty("PrepopulateToUsersOrganisation")
private YesOrNo prepopulateToUsersOrganisation;

@JsonProperty("OrgPolicyCaseAssignedRole")
private R orgPolicyCaseAssignedRole;

@JsonCreator
public OrganisationPolicy(
@JsonProperty("Organisation") Organisation organisation,
@JsonProperty("PreviousOrganisations") Set<PreviousOrganisationCollectionItem> previousOrganisations,
@JsonProperty("OrgPolicyReference") String orgPolicyReference,
@JsonProperty("PrepopulateToUsersOrganisation") YesOrNo prepopulateToUsersOrganisation,
@JsonProperty("OrgPolicyCaseAssignedRole") R orgPolicyCaseAssignedRole
) {
this.organisation = organisation;
this.previousOrganisations = previousOrganisations;
this.orgPolicyReference = orgPolicyReference;
this.prepopulateToUsersOrganisation = prepopulateToUsersOrganisation;
this.orgPolicyCaseAssignedRole = orgPolicyCaseAssignedRole;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import uk.gov.hmcts.ccd.sdk.type.AddressUK;
import uk.gov.hmcts.ccd.sdk.type.CaseLink;
import uk.gov.hmcts.ccd.sdk.type.CaseLocation;
import uk.gov.hmcts.ccd.sdk.type.ChangeOrganisationRequest;
import uk.gov.hmcts.ccd.sdk.type.ComponentLauncher;
import uk.gov.hmcts.ccd.sdk.type.Document;
import uk.gov.hmcts.ccd.sdk.type.DynamicList;
Expand All @@ -20,7 +21,9 @@
import uk.gov.hmcts.ccd.sdk.type.SearchCriteria;
import uk.gov.hmcts.ccd.sdk.type.WaysToPay;
import uk.gov.hmcts.ccd.sdk.type.YesOrNo;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.AcaSystemUserAccess;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.CaseLinkingAccess;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.CaseRoleID;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.CitizenAccess;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.ClaimantAccess;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.DefendantAccess;
Expand Down Expand Up @@ -354,7 +357,7 @@ public class PCSCase {
/**
* Combined list of all defendants in the case (i.e. primary defendant + additional defendants).
*/
@CCD(access = {ClaimantAccess.class, CitizenAccess.class, InternalCaseFlagAccess.class})
@CCD(access = {ClaimantAccess.class, CitizenAccess.class, InternalCaseFlagAccess.class, AcaSystemUserAccess.class})
private List<ListValue<Party>> allDefendants;

@JsonUnwrapped(prefix = "tenancy_")
Expand Down Expand Up @@ -722,4 +725,8 @@ public class PCSCase {

@CCD
private String dateIssuedString;

@CCD(access = {AcaSystemUserAccess.class})
private ChangeOrganisationRequest<CaseRoleID> changeOrganisationRequestField;

}
8 changes: 8 additions & 0 deletions src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/Party.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import uk.gov.hmcts.ccd.sdk.api.CCD;
import uk.gov.hmcts.ccd.sdk.type.AddressUK;
import uk.gov.hmcts.ccd.sdk.type.Flags;
import uk.gov.hmcts.ccd.sdk.type.OrganisationPolicy;
import uk.gov.hmcts.reform.pcs.LegalRepresentative;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.InternalCaseFlagAccess;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.OrganisationPolicyAccess;
import uk.gov.hmcts.reform.pcs.ccd.accesscontrol.UserRole;

import java.time.LocalDate;

Expand Down Expand Up @@ -53,4 +56,9 @@ public class Party {
)
private Flags defendantFlags;


@CCD(
access = {OrganisationPolicyAccess.class}
)
private OrganisationPolicy<UserRole> organisationPolicy;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package uk.gov.hmcts.reform.pcs.ccd.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import uk.gov.hmcts.reform.pcs.reference.dto.OrganisationDetailsResponse;

@Data
@Builder
@AllArgsConstructor
public class NocAccessChangeTaskData {

private String caseReference;
private String userId;
private String partyId;
private OrganisationDetailsResponse organisationDetailsResponse;
}
Loading
Loading