using Kinderstunde klein for date privileges

This commit is contained in:
Jottyfan
2024-07-30 11:22:50 +02:00
parent e3ebc387bb
commit d28f6b45fc
4 changed files with 8 additions and 8 deletions

View File

@ -43,14 +43,14 @@ public abstract class CommonController {
}
}
@ModelAttribute("hasDiakoneRole")
public Boolean hasDiakoneRole(Principal principal) {
@ModelAttribute("hasDateRole")
public Boolean hasDateRole(Principal principal) {
OAuth2AuthenticationToken token = (OAuth2AuthenticationToken) principal;
if (token != null) {
OAuth2User user = token.getPrincipal();
@SuppressWarnings("unchecked")
List<String> roles = (List<String>) user.getAttributes().get("roles");
return roles.contains("Diakone");
return roles.contains("Kinderstunde klein");
} else {
LOGGER.warn("token is null, no roles can be detected");
return false;