From 3c55d375c12f40f3ee5221dc9d4098488f7e08be Mon Sep 17 00:00:00 2001 From: devinleighsmith Date: Tue, 19 Sep 2023 14:58:40 -0700 Subject: [PATCH] psp-6906 management claims --- source/backend/dal/Security/Permissions.cs | 14 +- .../Alter Down/76_DML_PIMS_ROLE_CLAIM.sql | 23 ++ .../Alter Down/77_DML_PIMS_CLAIM.sql | 16 ++ .../Alter Down/78_DML_PIMS_ROLE.sql | 10 + .../Alter Up/075_DML_PIMS_ROLE.sql | 4 + .../Alter Up/76_DML_PIMS_CLAIM.sql | 30 +++ .../Alter Up/77_DML_PIMS_ROLE_CLAIM.sql | 243 ++++++++++++++++++ .../Build/051_DML_PIMS_ROLE.sql | 4 +- .../Build/074_DML_PIMS_CLAIM.sql | 22 ++ .../Build/075_DML_PIMS_ROLE_CLAIM.sql | 46 ++++ .../Alter Down/76_DML_PIMS_ROLE_CLAIM.sql | 23 ++ .../Alter Down/77_DML_PIMS_CLAIM.sql | 16 ++ .../Alter Down/78_DML_PIMS_ROLE.sql | 10 + .../Alter Up/075_DML_PIMS_ROLE.sql | 4 + .../Alter Up/76_DML_PIMS_CLAIM.sql | 30 +++ .../Alter Up/77_DML_PIMS_ROLE_CLAIM.sql | 243 ++++++++++++++++++ .../Build/051_DML_PIMS_ROLE.sql | 4 +- .../Build/074_DML_PIMS_CLAIM.sql | 22 ++ .../Build/075_DML_PIMS_ROLE_CLAIM.sql | 46 ++++ 19 files changed, 807 insertions(+), 3 deletions(-) create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/77_DML_PIMS_CLAIM.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/78_DML_PIMS_ROLE.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/075_DML_PIMS_ROLE.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/76_DML_PIMS_CLAIM.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/77_DML_PIMS_CLAIM.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/78_DML_PIMS_ROLE.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/075_DML_PIMS_ROLE.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/76_DML_PIMS_CLAIM.sql create mode 100644 source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql diff --git a/source/backend/dal/Security/Permissions.cs b/source/backend/dal/Security/Permissions.cs index 73dc670093..6ebda8a24f 100644 --- a/source/backend/dal/Security/Permissions.cs +++ b/source/backend/dal/Security/Permissions.cs @@ -171,10 +171,22 @@ public enum Permissions [Display(GroupName = "compensationRequisition", Name = "compensation-requisition-add", Description = "Ability to add new Acquisition File compensation requisitions.")] CompensationRequisitionAdd = 55, - [Display(GroupName = "compensationRequisition", Name = "compensation-requisition-edit", Description = "Ability to edit existing fAcquisition File compensation requisitions.")] + [Display(GroupName = "compensationRequisition", Name = "compensation-requisition-edit", Description = "Ability to edit existing Acquisition File compensation requisitions.")] CompensationRequisitionEdit = 56, [Display(GroupName = "compensationRequisition", Name = "compensation-requisition-delete", Description = "Ability to delete Acquisition File compensation requisitions.")] CompensationRequisitionDelete = 57, + + [Display(GroupName = "management", Name = "management-view", Description = "Ability to view Management information.")] + ManagementView = 58, + + [Display(GroupName = "management", Name = "management-add", Description = "Ability to add new Management information.")] + ManagementAdd = 59, + + [Display(GroupName = "management", Name = "management-edit", Description = "Ability to edit existing Management information.")] + ManagementEdit = 60, + + [Display(GroupName = "management", Name = "management-delete", Description = "Ability to delete Management information.")] + ManagementDelete = 61, } } diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql new file mode 100644 index 0000000000..a26eac91f9 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql @@ -0,0 +1,23 @@ +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; + +DECLARE @managementFunctional BIGINT; +DECLARE @managementReadOnly BIGINT; +SELECT @managementFunctional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @managementReadOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; + +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementView; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementEdit; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementAdd; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementDelete; + +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE ROLE_ID = @managementFunctional; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE ROLE_ID = @managementReadOnly; + +GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/77_DML_PIMS_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/77_DML_PIMS_CLAIM.sql new file mode 100644 index 0000000000..1476129d75 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/77_DML_PIMS_CLAIM.sql @@ -0,0 +1,16 @@ +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; + + +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementView; +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementEdit; +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementAdd; +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementDelete; + +GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/78_DML_PIMS_ROLE.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/78_DML_PIMS_ROLE.sql new file mode 100644 index 0000000000..72e236c2f9 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/78_DML_PIMS_ROLE.sql @@ -0,0 +1,10 @@ +DECLARE @managementFunctional BIGINT; +DECLARE @managementReadOnly BIGINT; +SELECT @managementFunctional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @managementReadOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; + + +DELETE FROM [dbo].[PIMS_ROLE] WHERE ROLE_ID = @managementFunctional; +DELETE FROM [dbo].[PIMS_ROLE] WHERE ROLE_ID = @managementReadOnly; + +GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/075_DML_PIMS_ROLE.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/075_DML_PIMS_ROLE.sql new file mode 100644 index 0000000000..3f33b10bc5 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/075_DML_PIMS_ROLE.sql @@ -0,0 +1,4 @@ +INSERT INTO PIMS_ROLE (ROLE_UID, NAME, DESCRIPTION, IS_PUBLIC, IS_DISABLED, SORT_ORDER, APP_CREATE_TIMESTAMP, APP_CREATE_USERID, APP_CREATE_USER_DIRECTORY, APP_LAST_UPDATE_TIMESTAMP, APP_LAST_UPDATE_USERID, APP_LAST_UPDATE_USER_DIRECTORY) +VALUES + (NEWID(), N'Management functional', N'Access to create, read, update Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), + (NEWID(), N'Management read-only', N'Access to read Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'); \ No newline at end of file diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/76_DML_PIMS_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/76_DML_PIMS_CLAIM.sql new file mode 100644 index 0000000000..80d8d5faa5 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/76_DML_PIMS_CLAIM.sql @@ -0,0 +1,30 @@ +BEGIN TRANSACTION; + +DECLARE @dbUserId nvarchar(30) = 'system'; +DECLARE @dbUserGuid uniqueidentifier = null; +DECLARE @appUserId nvarchar(30) = N'SEED'; +DECLARE @appUserGuid uniqueidentifier = '1b93f614-91da-4b32-b36e-bd2c6ebd12e2'; +DECLARE @appUserDirectory nvarchar(30) = N''; +DECLARE @seedTime DateTime = GETDATE(); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (57, N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'management-view', N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'Ability to view Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (58, N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'management-add', N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'Ability to add new Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (59, N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'management-edit', N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'Ability to edit existing Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (60, N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'management-delete', N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'Ability to delete Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +COMMIT TRANSACTION; diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql new file mode 100644 index 0000000000..d0dc318ce9 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql @@ -0,0 +1,243 @@ +BEGIN TRANSACTION; + +DECLARE @dbUserId nvarchar(30) = 'system'; +DECLARE @dbUserGuid uniqueidentifier = null; +DECLARE @appUserId nvarchar(30) = N'SEED'; +DECLARE @appUserGuid uniqueidentifier = '1b93f614-91da-4b32-b36e-bd2c6ebd12e2'; +DECLARE @appUserDirectory nvarchar(30) = N''; +DECLARE @seedTime DateTime = GETDATE(); + +DECLARE @functional BIGINT; +DECLARE @readOnly BIGINT; +DECLARE @systemAdministrator BIGINT; +SELECT @functional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @readOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; +SELECT @systemAdministrator = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'System Administrator'; + +-- **************************************************************************** +-- Declare and initialize the claims +-- **************************************************************************** +DECLARE @propertyView BIGINT; +DECLARE @propertyAdd BIGINT; +DECLARE @propertyEdit BIGINT; +DECLARE @propertyDelete BIGINT; +-- +select @propertyView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-view'; +select @propertyAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-add'; +select @propertyEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-edit'; +select @propertyDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @contactView BIGINT; +DECLARE @contactAdd BIGINT; +DECLARE @contactEdit BIGINT; +DECLARE @contactDelete BIGINT; +-- +select @contactView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-view'; +select @contactAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-add'; +select @contactEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-edit'; +select @contactDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +-- +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @noteView BIGINT; +DECLARE @noteAdd BIGINT; +DECLARE @noteEdit BIGINT; +DECLARE @noteDelete BIGINT; +-- +SELECT @noteView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-view'; +SELECT @noteAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-add'; +SELECT @noteEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-edit'; +SELECT @noteDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @documentView BIGINT; +DECLARE @documentAdd BIGINT; +DECLARE @documentEdit BIGINT; +DECLARE @documentDelete BIGINT; +-- +SELECT @documentView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-view'; +SELECT @documentAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-add'; +SELECT @documentEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-edit'; +SELECT @documentDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @rolePimsR BIGINT; +-- +select @rolePimsR = CLAIM_ID FROM PIMS_CLAIM where NAME = 'ROLE_PIMS_R'; + +/* Management Functional */ +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @rolePimsR, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +/* System Administrator */ +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +/* Management Read Only */ +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @managementView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @propertyView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @contactView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @noteView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @documentView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @rolePimsR, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +COMMIT TRANSACTION; diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/051_DML_PIMS_ROLE.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/051_DML_PIMS_ROLE.sql index 52c6e93f29..c8251c4d33 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/051_DML_PIMS_ROLE.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/051_DML_PIMS_ROLE.sql @@ -12,4 +12,6 @@ VALUES (NEWID(), N'Project functional', N'Access to create, read, update projects.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), (NEWID(), N'Project read-only', N'Access to read Projects.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), (NEWID(), N'Research functional', N'Access to create, read, update Research files.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), - (NEWID(), N'Research read-only', N'Access to read Research files.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'); \ No newline at end of file + (NEWID(), N'Research read-only', N'Access to read Research files.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), + (NEWID(), N'Management functional', N'Access to create, read, update Management information.',CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), + (NEWID(), N'Management read-only', N'Access to read Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'); \ No newline at end of file diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/074_DML_PIMS_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/074_DML_PIMS_CLAIM.sql index 67d5ebf934..18786faf3a 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/074_DML_PIMS_CLAIM.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/074_DML_PIMS_CLAIM.sql @@ -285,5 +285,27 @@ INSERT [dbo].[PIMS_CLAIM] VALUES (56, N'b175aa83-cee0-4cc3-907c-0c8e66610224', N'compensation-requisition-delete', N'b175aa83-cee0-4cc3-907c-0c8e66610224', N'Ability to delete Acquisition File compensation requisitions.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); +-- Property Managment claims +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (57, N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'management-view', N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'Ability to view Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (58, N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'management-add', N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'Ability to add new Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (59, N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'management-edit', N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'Ability to edit existing Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (60, N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'management-delete', N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'Ability to delete Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + + GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/075_DML_PIMS_ROLE_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/075_DML_PIMS_ROLE_CLAIM.sql index 44983ddf82..88f9ba52bf 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/075_DML_PIMS_ROLE_CLAIM.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Build/075_DML_PIMS_ROLE_CLAIM.sql @@ -9,6 +9,8 @@ DECLARE @acqfunc BIGINT; DECLARE @acgrdon BIGINT; DECLARE @llfunc BIGINT; DECLARE @llrdon BIGINT; +DECLARE @mafunc BIGINT; +DECLARE @mardon BIGINT; DECLARE @prjfunc BIGINT; DECLARE @prjrdon BIGINT; DECLARE @resfunc BIGINT; @@ -19,6 +21,8 @@ SELECT @acqfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Acquisition functional'; SELECT @acgrdon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Acquisition read-only'; SELECT @llfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Lease/License functional'; SELECT @llrdon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Lease/License read-only'; +SELECT @mafunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @mardon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; SELECT @prjfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Project functional'; SELECT @prjrdon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Project read-only'; SELECT @resfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Research functional'; @@ -139,6 +143,15 @@ SELECT @compensationAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'compensation-re SELECT @compensationEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'compensation-requisition-edit'; SELECT @compensationDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'compensation-requisition-delete'; +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; + INSERT INTO [dbo].[PIMS_ROLE_CLAIM] ([ROLE_ID], [CLAIM_ID], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [APP_LAST_UPDATE_USER_DIRECTORY]) VALUES -- Administrator @@ -189,6 +202,10 @@ VALUES (@sysadmn, @compensationEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@sysadmn, @compensationAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@sysadmn, @compensationDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), -- Acquisition Functional (@acqfunc, @propertyView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@acqfunc, @propertyAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), @@ -265,6 +282,35 @@ VALUES (@llrdon, @documentView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@llrdon, @projectView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@llrdon, @leaseView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + -- Management Functional + (@mafunc, @propertyView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @propertyAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @propertyEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @propertyDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @rolePimsR, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + -- Management Read + (@mardon, @propertyView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @contactView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @rolePimsR, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @noteView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @documentView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @managementView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), -- Project Functional (@prjfunc, @projectView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@prjfunc, @projectAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql new file mode 100644 index 0000000000..a26eac91f9 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql @@ -0,0 +1,23 @@ +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; + +DECLARE @managementFunctional BIGINT; +DECLARE @managementReadOnly BIGINT; +SELECT @managementFunctional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @managementReadOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; + +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementView; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementEdit; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementAdd; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementDelete; + +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE ROLE_ID = @managementFunctional; +DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE ROLE_ID = @managementReadOnly; + +GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/77_DML_PIMS_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/77_DML_PIMS_CLAIM.sql new file mode 100644 index 0000000000..1476129d75 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/77_DML_PIMS_CLAIM.sql @@ -0,0 +1,16 @@ +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; + + +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementView; +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementEdit; +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementAdd; +DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementDelete; + +GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/78_DML_PIMS_ROLE.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/78_DML_PIMS_ROLE.sql new file mode 100644 index 0000000000..72e236c2f9 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Down/78_DML_PIMS_ROLE.sql @@ -0,0 +1,10 @@ +DECLARE @managementFunctional BIGINT; +DECLARE @managementReadOnly BIGINT; +SELECT @managementFunctional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @managementReadOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; + + +DELETE FROM [dbo].[PIMS_ROLE] WHERE ROLE_ID = @managementFunctional; +DELETE FROM [dbo].[PIMS_ROLE] WHERE ROLE_ID = @managementReadOnly; + +GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/075_DML_PIMS_ROLE.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/075_DML_PIMS_ROLE.sql new file mode 100644 index 0000000000..3f33b10bc5 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/075_DML_PIMS_ROLE.sql @@ -0,0 +1,4 @@ +INSERT INTO PIMS_ROLE (ROLE_UID, NAME, DESCRIPTION, IS_PUBLIC, IS_DISABLED, SORT_ORDER, APP_CREATE_TIMESTAMP, APP_CREATE_USERID, APP_CREATE_USER_DIRECTORY, APP_LAST_UPDATE_TIMESTAMP, APP_LAST_UPDATE_USERID, APP_LAST_UPDATE_USER_DIRECTORY) +VALUES + (NEWID(), N'Management functional', N'Access to create, read, update Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), + (NEWID(), N'Management read-only', N'Access to read Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'); \ No newline at end of file diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/76_DML_PIMS_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/76_DML_PIMS_CLAIM.sql new file mode 100644 index 0000000000..80d8d5faa5 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/76_DML_PIMS_CLAIM.sql @@ -0,0 +1,30 @@ +BEGIN TRANSACTION; + +DECLARE @dbUserId nvarchar(30) = 'system'; +DECLARE @dbUserGuid uniqueidentifier = null; +DECLARE @appUserId nvarchar(30) = N'SEED'; +DECLARE @appUserGuid uniqueidentifier = '1b93f614-91da-4b32-b36e-bd2c6ebd12e2'; +DECLARE @appUserDirectory nvarchar(30) = N''; +DECLARE @seedTime DateTime = GETDATE(); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (57, N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'management-view', N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'Ability to view Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (58, N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'management-add', N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'Ability to add new Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (59, N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'management-edit', N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'Ability to edit existing Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (60, N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'management-delete', N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'Ability to delete Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +COMMIT TRANSACTION; diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql new file mode 100644 index 0000000000..d0dc318ce9 --- /dev/null +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Alter Up/77_DML_PIMS_ROLE_CLAIM.sql @@ -0,0 +1,243 @@ +BEGIN TRANSACTION; + +DECLARE @dbUserId nvarchar(30) = 'system'; +DECLARE @dbUserGuid uniqueidentifier = null; +DECLARE @appUserId nvarchar(30) = N'SEED'; +DECLARE @appUserGuid uniqueidentifier = '1b93f614-91da-4b32-b36e-bd2c6ebd12e2'; +DECLARE @appUserDirectory nvarchar(30) = N''; +DECLARE @seedTime DateTime = GETDATE(); + +DECLARE @functional BIGINT; +DECLARE @readOnly BIGINT; +DECLARE @systemAdministrator BIGINT; +SELECT @functional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @readOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; +SELECT @systemAdministrator = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'System Administrator'; + +-- **************************************************************************** +-- Declare and initialize the claims +-- **************************************************************************** +DECLARE @propertyView BIGINT; +DECLARE @propertyAdd BIGINT; +DECLARE @propertyEdit BIGINT; +DECLARE @propertyDelete BIGINT; +-- +select @propertyView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-view'; +select @propertyAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-add'; +select @propertyEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-edit'; +select @propertyDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'property-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @contactView BIGINT; +DECLARE @contactAdd BIGINT; +DECLARE @contactEdit BIGINT; +DECLARE @contactDelete BIGINT; +-- +select @contactView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-view'; +select @contactAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-add'; +select @contactEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-edit'; +select @contactDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'contact-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +-- +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @noteView BIGINT; +DECLARE @noteAdd BIGINT; +DECLARE @noteEdit BIGINT; +DECLARE @noteDelete BIGINT; +-- +SELECT @noteView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-view'; +SELECT @noteAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-add'; +SELECT @noteEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-edit'; +SELECT @noteDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'note-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @documentView BIGINT; +DECLARE @documentAdd BIGINT; +DECLARE @documentEdit BIGINT; +DECLARE @documentDelete BIGINT; +-- +SELECT @documentView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-view'; +SELECT @documentAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-add'; +SELECT @documentEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-edit'; +SELECT @documentDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'document-delete'; +-- ---------------------------------------------------------------------------- +DECLARE @rolePimsR BIGINT; +-- +select @rolePimsR = CLAIM_ID FROM PIMS_CLAIM where NAME = 'ROLE_PIMS_R'; + +/* Management Functional */ +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @managementDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @propertyDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @contactDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @noteDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @documentDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@functional, @rolePimsR, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +/* System Administrator */ +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementEdit, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementAdd, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@systemAdministrator, @managementDelete, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + +/* Management Read Only */ +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @managementView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @propertyView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @contactView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @noteView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @documentView, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +INSERT [dbo].[PIMS_ROLE_CLAIM] + ([ROLE_ID], [CLAIM_ID], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (@readOnly, @rolePimsR, 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId) + + +COMMIT TRANSACTION; diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/051_DML_PIMS_ROLE.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/051_DML_PIMS_ROLE.sql index 52c6e93f29..c8251c4d33 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/051_DML_PIMS_ROLE.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/051_DML_PIMS_ROLE.sql @@ -12,4 +12,6 @@ VALUES (NEWID(), N'Project functional', N'Access to create, read, update projects.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), (NEWID(), N'Project read-only', N'Access to read Projects.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), (NEWID(), N'Research functional', N'Access to create, read, update Research files.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), - (NEWID(), N'Research read-only', N'Access to read Research files.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'); \ No newline at end of file + (NEWID(), N'Research read-only', N'Access to read Research files.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), + (NEWID(), N'Management functional', N'Access to create, read, update Management information.',CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), + (NEWID(), N'Management read-only', N'Access to read Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'); \ No newline at end of file diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/074_DML_PIMS_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/074_DML_PIMS_CLAIM.sql index 67d5ebf934..18786faf3a 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/074_DML_PIMS_CLAIM.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/074_DML_PIMS_CLAIM.sql @@ -285,5 +285,27 @@ INSERT [dbo].[PIMS_CLAIM] VALUES (56, N'b175aa83-cee0-4cc3-907c-0c8e66610224', N'compensation-requisition-delete', N'b175aa83-cee0-4cc3-907c-0c8e66610224', N'Ability to delete Acquisition File compensation requisitions.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); +-- Property Managment claims +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (57, N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'management-view', N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'Ability to view Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (58, N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'management-add', N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'Ability to add new Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (59, N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'management-edit', N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'Ability to edit existing Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + +INSERT [dbo].[PIMS_CLAIM] + ([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) +VALUES + (60, N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'management-delete', N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'Ability to delete Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); + + GO diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/075_DML_PIMS_ROLE_CLAIM.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/075_DML_PIMS_ROLE_CLAIM.sql index 44983ddf82..88f9ba52bf 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/075_DML_PIMS_ROLE_CLAIM.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S63_00/Build/075_DML_PIMS_ROLE_CLAIM.sql @@ -9,6 +9,8 @@ DECLARE @acqfunc BIGINT; DECLARE @acgrdon BIGINT; DECLARE @llfunc BIGINT; DECLARE @llrdon BIGINT; +DECLARE @mafunc BIGINT; +DECLARE @mardon BIGINT; DECLARE @prjfunc BIGINT; DECLARE @prjrdon BIGINT; DECLARE @resfunc BIGINT; @@ -19,6 +21,8 @@ SELECT @acqfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Acquisition functional'; SELECT @acgrdon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Acquisition read-only'; SELECT @llfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Lease/License functional'; SELECT @llrdon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Lease/License read-only'; +SELECT @mafunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; +SELECT @mardon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; SELECT @prjfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Project functional'; SELECT @prjrdon = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Project read-only'; SELECT @resfunc = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Research functional'; @@ -139,6 +143,15 @@ SELECT @compensationAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'compensation-re SELECT @compensationEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'compensation-requisition-edit'; SELECT @compensationDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'compensation-requisition-delete'; +DECLARE @managementView BIGINT; +DECLARE @managementAdd BIGINT; +DECLARE @managementEdit BIGINT; +DECLARE @managementDelete BIGINT; +SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; +SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; +SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; +SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; + INSERT INTO [dbo].[PIMS_ROLE_CLAIM] ([ROLE_ID], [CLAIM_ID], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [APP_LAST_UPDATE_USER_DIRECTORY]) VALUES -- Administrator @@ -189,6 +202,10 @@ VALUES (@sysadmn, @compensationEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@sysadmn, @compensationAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@sysadmn, @compensationDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@sysadmn, @managementDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), -- Acquisition Functional (@acqfunc, @propertyView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@acqfunc, @propertyAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), @@ -265,6 +282,35 @@ VALUES (@llrdon, @documentView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@llrdon, @projectView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@llrdon, @leaseView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + -- Management Functional + (@mafunc, @propertyView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @propertyAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @propertyEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @propertyDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @contactDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @rolePimsR, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @noteDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @documentDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementEdit, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mafunc, @managementDelete, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + -- Management Read + (@mardon, @propertyView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @contactView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @rolePimsR, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @noteView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @documentView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), + (@mardon, @managementView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), -- Project Functional (@prjfunc, @projectView, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''), (@prjfunc, @projectAdd, N'SEED', @appUserGuid, N'SEED', @appUserGuid, '', ''),