-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SELC-4970] Feat: Refactor "/authorize" API to have institutionId as …
…optional query param (#136)
- Loading branch information
1 parent
9995632
commit 2915245
Showing
11 changed files
with
325 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 11 additions & 3 deletions
14
apps/user-ms/src/main/java/it/pagopa/selfcare/user/constant/SelfCareRole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
package it.pagopa.selfcare.user.constant; | ||
|
||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
import java.util.stream.Stream; | ||
|
||
@Getter | ||
public enum SelfCareRole { | ||
MANAGER(SelfCareAuthority.ADMIN), | ||
DELEGATE(SelfCareAuthority.ADMIN), | ||
SUB_DELEGATE(SelfCareAuthority.ADMIN), | ||
OPERATOR(SelfCareAuthority.LIMITED); | ||
|
||
private SelfCareAuthority selfCareAuthority; | ||
private final SelfCareAuthority selfCareAuthority; | ||
|
||
private SelfCareRole(SelfCareAuthority selfCareAuthority) { | ||
this.selfCareAuthority = selfCareAuthority; | ||
} | ||
|
||
public SelfCareAuthority getSelfCareAuthority() { | ||
return this.selfCareAuthority; | ||
public static List<SelfCareRole> fromSelfCareAuthority(String selfCareAuthority) { | ||
return Stream.of(SelfCareRole.values()) | ||
.filter(role -> role.getSelfCareAuthority().name().equals(selfCareAuthority)) | ||
.toList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.