using Kinderstunde klein for date privileges
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user