Skip to content

Commit

Permalink
feat: remove unused role authorization mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mebo4b committed Nov 8, 2021
1 parent 37a9960 commit 641fbe2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public enum Authority {
ANONYMOUS(Role.ANONYMOUS, singletonList(ANONYMOUS_DEFAULT)),
USER(Role.USER, singletonList(USER_DEFAULT)),
CONSULTANT(Role.CONSULTANT, singletonList(CONSULTANT_DEFAULT)),
U25_CONSULTANT(Role.U25_CONSULTANT, singletonList(USE_FEEDBACK)),
U25_MAIN_CONSULTANT(Role.U25_MAIN_CONSULTANT,
asList(VIEW_ALL_FEEDBACK_SESSIONS, VIEW_ALL_PEER_SESSIONS, ASSIGN_CONSULTANT_TO_SESSION,
ASSIGN_CONSULTANT_TO_ENQUIRY, VIEW_AGENCY_CONSULTANTS)),
TECHNICAL(Role.TECHNICAL, singletonList(TECHNICAL_DEFAULT));

private final Role userRole;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public enum Role {
TECHNICAL("technical"),
USER("user"),
CONSULTANT("consultant"),
U25_CONSULTANT("u25-consultant"),
U25_MAIN_CONSULTANT("u25-main-consultant"),
ANONYMOUS("anonymous");

private final String roleName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,6 @@ public void getAuthoritiesByRoleName_Should_ReturnCorrectRoles_ForKeycloakRoleUs

}

@Test
public void getAuthoritiesByRoleName_Should_ReturnCorrectRoles_ForKeycloakRoleU25Consultant() {

List<String> result = Authority.getAuthoritiesByUserRole(Role.U25_CONSULTANT);

assertNotNull(result);
assertTrue(result.contains(AuthorityValue.USE_FEEDBACK));
assertEquals(1, result.size());

}

@Test
public void getAuthoritiesByRoleName_Should_ReturnCorrectRoles_ForKeycloakRoleU25MainConsultant() {

List<String> result = Authority.getAuthoritiesByUserRole(Role.U25_MAIN_CONSULTANT);

assertNotNull(result);
assertTrue(result.contains(AuthorityValue.VIEW_ALL_FEEDBACK_SESSIONS));
assertTrue(result.contains(AuthorityValue.VIEW_ALL_PEER_SESSIONS));
assertTrue(result.contains(AuthorityValue.ASSIGN_CONSULTANT_TO_SESSION));
assertTrue(result.contains(AuthorityValue.ASSIGN_CONSULTANT_TO_ENQUIRY));
assertTrue(result.contains(AuthorityValue.VIEW_AGENCY_CONSULTANTS));
assertEquals(5, result.size());

}

@Test
public void getAuthoritiesByRoleName_Should_ReturnCorrectRoles_ForKeycloakRoleTechnical() {

Expand Down

0 comments on commit 641fbe2

Please sign in to comment.