Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMP-4616: Flyway Updates : Add new role MEDIA_IN_PERPETUITY #2461

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ void shouldGetSecurityGroups() throws JsonProcessingException {
checkGroup(staticGroups.get(6), "hmcts_staff_4", false, 4, true, 127);
checkGroup(staticGroups.get(7), "hmcts_staff_5", true, 5, true, 127);
checkGroup(staticGroups.get(8), "hmcts_staff_6", true, 6, true, 127);
checkGroup(staticGroups.get(9), "MEDIA_IN_PERPETUITY", false, 10, true, null);
checkGroup(staticGroups.get(10), "MID_TIER", true, 14, false, null);
checkGroup(staticGroups.get(9), "MID_TIER", true, 14, false, null);
checkGroup(staticGroups.get(10), "MEDIA_IN_PERPETUITY", false, 10, true, null);
checkGroup(staticGroups.get(11), "SUPER_ADMIN", true, 8, true, null);
checkGroup(staticGroups.get(12), "SUPER_USER", true, 7, true, null);
checkGroup(staticGroups.get(13), "XHIBIT", true, 11, false, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void shouldGetSecurityRoles() {
"id": 9,
"role_name": "MEDIA_ACCESSOR",
"display_name": "Media Accessor",
"display_state": true
"display_state": false
},
{
"id": 10,
Expand Down Expand Up @@ -111,6 +111,12 @@ void shouldGetSecurityRoles() {
"role_name": "MID_TIER",
"display_name": "Mid Tier",
"display_state": false
},
{
"id": 15,
"role_name": "MEDIA_IN_PERPETUITY",
"display_name": "Media in Perpetuity",
"display_state": true
}
]
""",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void closeHibernateSession() {
@Test
void shouldFindAllSecurityRoles() {
List<SecurityRoleEntity> securityRoleEntityList = securityRoleRepository.findAll();
assertEquals(14, securityRoleEntityList.size());
assertEquals(15, securityRoleEntityList.size());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void getSecurityRolesShouldSucceedAndReturnAllRoles() throws Exception {
"id": 9,
"role_name": "MEDIA_ACCESSOR",
"display_name": "Media Accessor",
"display_state": true
"display_state": false
},
{
"id": 10,
Expand Down Expand Up @@ -129,6 +129,12 @@ void getSecurityRolesShouldSucceedAndReturnAllRoles() throws Exception {
"role_name": "MID_TIER",
"display_name": "Mid Tier",
"display_state": false
},
{
"id": 15,
"role_name": "MEDIA_IN_PERPETUITY",
"display_name": "Media in Perpetuity",
"display_state": true
}
]
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@
"courthouse_ids": [],
"name": "MEDIA_IN_PERPETUITY",
"display_name": "MEDIA_IN_PERPETUITY",
"security_role_id": 10
"security_role_id": 15
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
insert into security_role (rol_id, role_name, display_name, display_state)
values (nextval('rol_seq'), 'MEDIA_IN_PERPETUITY', 'Media in Perpetuity', TRUE);


update security_group
set rol_id = (select rol_id from security_role where role_name = 'MEDIA_IN_PERPETUITY')
where grp_id = (select grp_id from security_group where group_name = 'MEDIA_IN_PERPETUITY');

update security_role
set display_state = FALSE
where role_name = 'MEDIA_ACCESSOR';





Loading