-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from InseeFr/develop
feat: add management endpoints and cucumber tests
- Loading branch information
Showing
135 changed files
with
2,648 additions
and
1,035 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ build/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
src/main/resources/application-*.properties |
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
19 changes: 0 additions & 19 deletions
19
src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthUser.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...a/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthenticationUserHelper.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package fr.insee.survey.datacollectionmanagement.config.auth.user; | ||
|
||
import org.springframework.security.core.Authentication; | ||
import org.springframework.security.core.context.SecurityContextHolder; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class AuthenticationUserHelper { | ||
|
||
public Authentication getCurrentUser(){ | ||
return SecurityContextHolder.getContext().getAuthentication(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...n/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthorityPrivileges.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package fr.insee.survey.datacollectionmanagement.config.auth.user; | ||
|
||
public class AuthorityPrivileges { | ||
private AuthorityPrivileges() { | ||
throw new IllegalArgumentException("Constant class"); | ||
} | ||
|
||
public static final String HAS_MANAGEMENT_PRIVILEGES = "hasAnyRole('INTERNAL_USER', 'WEB_CLIENT', 'ADMIN')"; | ||
public static final String HAS_REPONDENT_PRIVILEGES = "hasRole('RESPONDENT')"; | ||
public static final String HAS_REPONDENT_LIMITATED_PRIVILEGES = "hasRole('RESPONDENT') && #id.toLowerCase() == authentication.name.toLowerCase() "; | ||
public static final String HAS_ADMIN_PRIVILEGES = "hasAnyRole('WEB_CLIENT', 'ADMIN)"; | ||
public static final String HAS_USER_PRIVILEGES = "hasAnyRole('INTERNAL_USER', 'WEB_CLIENT', 'RESPONDENT', 'ADMIN')"; | ||
|
||
|
||
} |
Oops, something went wrong.