Skip to content

Commit

Permalink
fixed unleash roles 🐰
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-fintlabs committed Jun 24, 2024
1 parent a149f34 commit c123932
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public ResponseEntity<Void> unLinkLegalContact(@PathVariable String orgName, @Pa
@PutMapping("/contacts/roles/{nin}/{roles}")
public ResponseEntity<Void> addRoles(@PathVariable String orgName, @PathVariable final String nin, @PathVariable final RoleConfig.RoleId... roles) {

if (!unleashClient.isEnabled("fint-kunde-portal.roles")) {
if (!unleashClient.isEnabled("fint-kunde-portal.roles-new")) {
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}

Expand All @@ -159,7 +159,7 @@ public ResponseEntity<Void> addRoles(@PathVariable String orgName, @PathVariable
@DeleteMapping("/contacts/roles/{nin}/{roles}")
public ResponseEntity<Void> removeRoles(@PathVariable String orgName, @PathVariable final String nin, @PathVariable final RoleConfig.RoleId... roles) {

if (!unleashClient.isEnabled("fint-kunde-portal.roles")) {
if (!unleashClient.isEnabled("fint-kunde-portal.roles-new")) {
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public RoleController(RoleConfig roleConfig, Unleash unleashClient) {

@GetMapping
public ResponseEntity<List<RoleConfig.Role>> getRoles() {
if (unleashClient.isEnabled("fint-kunde-portal.roles")) {
if (unleashClient.isEnabled("fint-kunde-portal.roles-new")) {
return ResponseEntity.ok(roleConfig.getRoles());
}
return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/no/fint/portal/security/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private Collection<FintPortalAuthority> getAuthorities(Contact contact) {
if (contact == null) {
return Collections.emptyList();
}
if (unleashClient.isEnabled("fint-kunde-portal.roles")) {
if (unleashClient.isEnabled("fint-kunde-portal.roles-new")) {
if (contact.getRoles() == null) {
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class IntegrationTest {

@BeforeEach
void setUp() {
when(unleash.isEnabled("fint-kunde-portal.roles")).thenReturn(true);
when(unleash.isEnabled("fint-kunde-portal.roles-new")).thenReturn(true);
}

@Test
Expand Down

0 comments on commit c123932

Please sign in to comment.