protected AdministerUserCommand( PscUser user, ProvisioningSessionFactory provisioningSessionFactory, AuthorizationManager authorizationManager, AuthenticationSystem authenticationSystem, ApplicationSecurityManager applicationSecurityManager, CsmUserCache csmUserCache) { super( user == null ? AuthorizationObjectFactory.createPscUser() : user, provisioningSessionFactory, applicationSecurityManager); this.authorizationManager = authorizationManager; this.authenticationSystem = authenticationSystem; this.csmUserCache = csmUserCache; }
private void saveOrUpdateUser() throws CSTransactionException { if (isNewUser() && lookUpBoundUser) { User found = authorizationManager.getUser(getUser().getCsmUser().getLoginName()); if (found != null) { copyBoundProperties(this.getUser().getCsmUser(), found); setUser(AuthorizationObjectFactory.createPscUser(found)); modifyCsmUser(); } else { authorizationManager.createUser(getUser().getCsmUser()); } } else if (getUser().getCsmUser().getUserId() == null) { authorizationManager.createUser(getUser().getCsmUser()); } else { modifyCsmUser(); } }