SET @TERM_ID = 9002;
SET @TERM_NAME = 'HT158002-FreeTrail';
SET @TERM_UDID = 'team-ht15802-freetrail';
SET @ROLE_ID = 9002;
SET @ROLE_NAME = 'managed:teams:9002:permissions';
SET @ROLE_UDID = 'role-ht15802-freetrail';


DELETE from team where id = @TERM_ID;
INSERT INTO team
(id, name, org_id, created, updated, uid, email)
VALUES(@TERM_ID, @TERM_NAME, 1, '2024-12-26 17:47:36', '2024-12-26 17:47:36', @TERM_UDID, 'free.trail@hitrust.com');

DELETE from role where id = @TERM_ID;
INSERT INTO `role`
(id, name, description, version, org_id, uid, created, updated, display_name, group_name, hidden)
VALUES(@ROLE_ID, @ROLE_NAME, '', 0, 1, @ROLE_UDID, '2025-04-01 06:22:22', '2025-04-01 06:22:22', '', '', 0);

DELETE from team_role where team_id = @TERM_ID and role_id = @ROLE_ID;
INSERT INTO team_role
(org_id, team_id, role_id, created)
VALUES( 1, @TERM_ID, @ROLE_ID, '2025-04-17 13:53:57');


SET @PERMISSION_SCOPE = 'dashboards:uid:R970101';
SET @DESHBOARD_ID = 'R970101';
DELETE from permission where identifier = CONVERT(@DESHBOARD_ID USING utf8mb4) COLLATE utf8mb4_0900_ai_ci;
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'annotations:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:view', @PERMISSION_SCOPE, '2025-05-06 07:38:35', '2025-05-06 07:38:35', 'dashboards', 'uid', @DESHBOARD_ID);

SET @PERMISSION_SCOPE = 'dashboards:uid:R970199';
SET @DESHBOARD_ID = 'R970199';
DELETE from permission where identifier = CONVERT(@DESHBOARD_ID USING utf8mb4) COLLATE utf8mb4_0900_ai_ci;
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'annotations:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:view', @PERMISSION_SCOPE, '2025-05-06 07:38:35', '2025-05-06 07:38:35', 'dashboards', 'uid', @DESHBOARD_ID);

SET @TERM_ID = 9004;
SET @TERM_NAME = 'HT158004-FreeTrail';
SET @TERM_UDID = 'team-ht15804-freetrail';
SET @ROLE_ID = 9004;
SET @ROLE_NAME = 'managed:teams:9004:permissions';
SET @ROLE_UDID = 'role-ht15804-freetrail';



DELETE from team where id = @TERM_ID;
INSERT INTO team
(id, name, org_id, created, updated, uid, email)
VALUES(@TERM_ID, @TERM_NAME, 1, '2024-12-26 17:47:36', '2024-12-26 17:47:36', @TERM_UDID, 'free.trail@hitrust.com');

DELETE from role where id = @TERM_ID;
INSERT INTO `role`
(id, name, description, version, org_id, uid, created, updated, display_name, group_name, hidden)
VALUES(@ROLE_ID, @ROLE_NAME, '', 0, 1, @ROLE_UDID, '2025-04-01 06:22:22', '2025-04-01 06:22:22', '', '', 0);

DELETE from team_role where team_id = @TERM_ID and role_id = @ROLE_ID;
INSERT INTO team_role
(org_id, team_id, role_id, created)
VALUES( 1, @TERM_ID, @ROLE_ID, '2025-04-17 13:53:57');

SET @PERMISSION_SCOPE = 'dashboards:uid:R980101';
SET @DESHBOARD_ID = 'R980101';
DELETE from permission where identifier = CONVERT(@DESHBOARD_ID USING utf8mb4) COLLATE utf8mb4_0900_ai_ci;
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'annotations:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:view', @PERMISSION_SCOPE, '2025-05-06 07:38:35', '2025-05-06 07:38:35', 'dashboards', 'uid', @DESHBOARD_ID);

SET @PERMISSION_SCOPE = 'dashboards:uid:R980199';
SET @DESHBOARD_ID = 'R980199';
DELETE from permission where identifier = CONVERT(@DESHBOARD_ID USING utf8mb4) COLLATE utf8mb4_0900_ai_ci;
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'annotations:read', @PERMISSION_SCOPE, '2025-05-06 06:41:52', '2025-05-06 06:41:52', 'dashboards', 'uid', @DESHBOARD_ID);
INSERT INTO permission
(role_id, `action`, `scope`, created, updated, kind, `attribute`, identifier)
VALUES(@ROLE_ID, 'dashboards:view', @PERMISSION_SCOPE, '2025-05-06 07:38:35', '2025-05-06 07:38:35', 'dashboards', 'uid', @DESHBOARD_ID);

