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

Add new TRAININGHEALTHAUTH SPG #47

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ private static List<String> loadRoles(Jwt jwt) {
public static List<String> loadPermissions(Jwt jwt, Map<String, List<String>> rolePermissions) {
List<String> roles = loadRoles(jwt);
List<String> permissions = new ArrayList<>();
roles.forEach(role -> {
permissions.addAll(rolePermissions.get(role));
roles.forEach(role -> {
List<String> currentPermissions = rolePermissions.get(role);
if (currentPermissions != null) {
permissions.addAll(currentPermissions);
} else {
logger.warn("Role {} has no permissions defined.", role);
}

});

return permissions;
Expand Down
10 changes: 7 additions & 3 deletions backend/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ v2:
# Mapping of roles (SPGs) to specific permissions
security:
rolePermissions:
DUMMY:
- Dummy
E45:
- E45
Eligibility:
ELIGIBILITY:
- E45
- R15
- R41
Dummy:
- Dummy
TRAININGHEALTHAUTH:
- E45
- R15
- R41
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
name: 'App',
data: function () {
return {
dev: import.meta.env.MODE === 'DEV',
dev: import.meta.env.MODE === 'development',
}
},
computed: {
Expand Down