diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/15_All_Assign_Service_To_Org_User_Group.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/15_All_Assign_Service_To_Org_User_Group.sql index 01e292f4..6af33c9b 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/15_All_Assign_Service_To_Org_User_Group.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/15_All_Assign_Service_To_Org_User_Group.sql @@ -135,7 +135,8 @@ SELECT Assign_Service_To_Org_User_Group('CAT_USER','Contract Award Service (CAS) SELECT Assign_Service_To_Org_User_Group('CAT_USER','Contract Award Service (CAS) - add service','CAT_USER','Contract Award Service role to create buyer in Jagger'); SELECT Assign_Service_To_Org_User_Group('CAT_USER','Contract Award Service (CAS) - add service','CAT_USER','Contract Award Service role to merge buyer via Jaggaer'); -SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing buyer role for CAS -Optional'); +-- Following Role no longer required. task-5029-con-3730 +-- SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing buyer role for CAS -Optional'); SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing Tile for Buyer User'); SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing buyer role to access Jagger'); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Dashboard_Service.sql index fd0cc8e7..78860e1a 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'CAS_USER' AND "CcsAccessRoleName" = 'Contract Award Service (CAS) - add to dashboard' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('CAS_USER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Login_Director.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Login_Director.sql index 6bf4d976..2d8dc18e 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Login_Director.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_CAS_Roles/Add_Role_CAS_USER_Login_Director.sql @@ -19,6 +19,11 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'CAS_USER' AND "CcsAccessRoleName" = 'Contract Award Service role to create buyer in Jagger-LD' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_FP_USER_Roles/Add_Role_FP_USER_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_FP_USER_Roles/Add_Role_FP_USER_Dashboard_Service.sql index cc3233a1..26a56698 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_FP_USER_Roles/Add_Role_FP_USER_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_FP_USER_Roles/Add_Role_FP_USER_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'FP_USER' AND "CcsAccessRoleName" = 'Fleet Portal Tile' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('FP_USER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_Dashboard_Service.sql index ab777634..c0cee6a1 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_BUYER' AND "CcsAccessRoleName" = 'eSourcing Tile for Buyer User' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('JAEGGER_BUYER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_eSourcing.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_eSourcing.sql index eb6b44b7..3483ea57 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_eSourcing.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_BUYER_Roles/Add_Role_JAEGGER_BUYER_eSourcing.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_BUYER' AND "CcsAccessRoleName" = 'eSourcing buyer role to access Jagger' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('JAEGGER_BUYER_ES', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Contract_Award_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Contract_Award_Service.sql index 50913960..cd2acd38 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Contract_Award_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Contract_Award_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_SUPPLIER' AND "CcsAccessRoleName" = 'eSourcing Supplier role for CAS for QA Pages Access' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('JAEGGER_SUPPLIER_CAS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Dashboard_Service.sql index 2eacbb4d..84e0dc08 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_SUPPLIER' AND "CcsAccessRoleName" = 'eSourcing Tile for Supplier User' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('JAEGGER_SUPPLIER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_eSourcing.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_eSourcing.sql index d33f1cfa..258f46d2 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_eSourcing.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_JAGGER_SUPPLIER_Roles/Add_Role_JAEGGER_SUPPLIER_eSourcing.sql @@ -22,6 +22,12 @@ INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('JAEGGER_SUPPLIER_ES', clientServiceId, 0, 0, now(), now(), false); + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_SUPPLIER' AND "CcsAccessRoleName" = 'eSourcing Supplier role to access Jagger' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + SELECT "Id" into ServicePermissionId From public."ServicePermission" WHERE "ServicePermissionName" = 'JAEGGER_SUPPLIER_ES' AND "CcsServiceId" = clientServiceId LIMIT 1; INSERT INTO public."CcsAccessRole"( diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DATA_MIGRATION_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DATA_MIGRATION_Dashboard_Service.sql index 100248d9..935f87d5 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DATA_MIGRATION_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DATA_MIGRATION_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'DATA_MIGRATION' AND "CcsAccessRoleName" = 'Access Data Migration' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('DATA_MIGRATION_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DigiTS_USER_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DigiTS_USER_Dashboard_Service.sql index d7796e70..7d44d9ed 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DigiTS_USER_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_DigiTS_USER_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'DigiTS_USER' AND "CcsAccessRoleName" = 'Access DigiTS' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('DigiTS_USER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_EL_USER_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_EL_USER_Dashboard_Service.sql index 0d561ef2..ed4f4783 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_EL_USER_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_EL_USER_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'EL_USER' AND "CcsAccessRoleName" = 'Buyer Supplier Information' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('EL_USER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_RMI_USER_DS_Dashboard_Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_RMI_USER_DS_Dashboard_Service.sql index 7df8f61e..c23a2e9b 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_RMI_USER_DS_Dashboard_Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_RMI_USER_DS_Dashboard_Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'RMI_USER' AND "CcsAccessRoleName" = 'RMI Tile' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('RMI_USER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SAML_CLIENT_USER_Dashboard Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SAML_CLIENT_USER_Dashboard Service.sql index 401412ba..4f134919 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SAML_CLIENT_USER_Dashboard Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SAML_CLIENT_USER_Dashboard Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'TEST_SAML_CLIENT_USER' AND "CcsAccessRoleName" = 'SAML Client Tile' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('TEST_SAML_CLIENT_USER_DS', clientServiceId, 0, 0, now(), now(), false); diff --git a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SSO_CLIENT_USER_Dashboard Service.sql b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SSO_CLIENT_USER_Dashboard Service.sql index 97150d1f..a0a6007d 100644 --- a/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SSO_CLIENT_USER_Dashboard Service.sql +++ b/api/CcsSso.Core.DbMigrations/Scripts/Phase3_Sprint6/2_Add_Roles/Add_Role_TEST_SSO_CLIENT_USER_Dashboard Service.sql @@ -18,6 +18,12 @@ if (clientServiceId is null) then return 1; end if; + IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'TEST_SSO_CLIENT_USER' AND "CcsAccessRoleName" = 'SSO Client Tile' LIMIT 1) THEN + raise notice 'Role already exists'; + return 1; + END IF; + + INSERT INTO public."ServicePermission"( "ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted") VALUES ('TEST_SSO_CLIENT_USER_DS', clientServiceId, 0, 0, now(), now(), false);