}
public ArgeoUser getCurrentUser() {
- Authentication authentication = SecurityContextHolder.getContext()
- .getAuthentication();
- ArgeoUser argeoUser = ArgeoUserDetails.asArgeoUser(authentication);
+ ArgeoUser argeoUser = ArgeoUserDetails.securityContextUser();
if (argeoUser == null)
return null;
if (argeoUser.getRoles().contains(defaultRole))
.executeReadWrite(new ContextExecutor() {
public Object executeWithContext(DirContext ctx)
throws NamingException {
- return LdapUtils.getFullDn(usernameMapper
- .buildDn(superuserName), ctx);
+ return LdapUtils.getFullDn(
+ usernameMapper.buildDn(superuserName), ctx);
}
});
context.setAttributeValue("cn", group);
// Add superuser because cannot create empty group
- context.setAttributeValue(groupMemberAttributeName, superuserDn
- .toString());
+ context.setAttributeValue(groupMemberAttributeName,
+ superuserDn.toString());
ldapTemplate.bind(groupDn, context, null);
}