@Test public void testGetPrincipal() throws Exception { User user = createUser(null); assertTrue(user.getPrincipal() instanceof SystemUserPrincipal); }
@NotNull @Override public Principal getPrincipal() throws RepositoryException { if (isAdmin()) { return new AdminPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } else { return new SystemUserPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } }
SystemUserImpl extends UserImpl { @NotNull @Override public Principal getPrincipal() throws RepositoryException { if (isAdmin()) { return new AdminPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } else { return new SystemUserPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } } }
SystemUserImpl extends UserImpl { @NotNull @Override public Principal getPrincipal() throws RepositoryException { if (isAdmin()) { return new AdminPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } else { return new SystemUserPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } } SystemUserImpl(@NotNull String id, @NotNull Tree tree, @NotNull UserManagerImpl userManager); }
SystemUserImpl extends UserImpl { @NotNull @Override public Principal getPrincipal() throws RepositoryException { if (isAdmin()) { return new AdminPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } else { return new SystemUserPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } } SystemUserImpl(@NotNull String id, @NotNull Tree tree, @NotNull UserManagerImpl userManager); @NotNull @Override Principal getPrincipal(); @Override boolean isSystemUser(); @Override void changePassword(@Nullable String password); @Override void changePassword(@Nullable String password, @NotNull String oldPassword); }
SystemUserImpl extends UserImpl { @NotNull @Override public Principal getPrincipal() throws RepositoryException { if (isAdmin()) { return new AdminPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } else { return new SystemUserPrincipalImpl(getPrincipalName(), getTree(), getUserManager().getNamePathMapper()); } } SystemUserImpl(@NotNull String id, @NotNull Tree tree, @NotNull UserManagerImpl userManager); @NotNull @Override Principal getPrincipal(); @Override boolean isSystemUser(); @Override void changePassword(@Nullable String password); @Override void changePassword(@Nullable String password, @NotNull String oldPassword);  }