Map<String, Object> attributes,
ConfiguredObject... otherParents)
{
if(childClass == User.class)
{
Principal p = new UsernamePrincipal((String) attributes.get("name"));
if(getSecurityManager().authoriseMethod(Operation.UPDATE, "UserManagement", "createUser"))
{
if(getPrincipalDatabase().createPrincipal(p, ((String)attributes.get("password")).toCharArray()))
{
return (C) new PrincipalAdapter(p);