if(!profileauthproxy.getEndEntityProfileAuthorization(admin, data.getEndEntityProfileId(),EndEntityProfileAuthorizationProxy.EDIT_RIGHTS)){
if(!profileauthproxy.getEndEntityProfileAuthorization(admin, data.getEndEntityProfileId(),EndEntityProfileAuthorizationProxy.EDIT_RIGHTS, LogEntry.MODULE_RA)){
    public void setClearTextPassword(Admin admin, String username, String password) throws UserDoesntFullfillEndEntityProfile, AuthorizationDeniedException,FinderException, RemoteException{        debug(">setClearTextPassword("+username+", hiddenpwd)");        // Find user        UserDataPK pk = new UserDataPK(username);        UserDataLocal data = home.findByPrimaryKey(pk);        if(globalconfiguration.getEnableEndEntityProfileLimitations()){          // Check if user fulfills it's profile.          EndEntityProfile profile = raadminsession.getEndEntityProfile(admin, data.getEndEntityProfileId());                 if(profile.isRequired(EndEntityProfile.CLEARTEXTPASSWORD,0) && profile.getValue(EndEntityProfile.CLEARTEXTPASSWORD,0).equals(EndEntityProfile.FALSE)){            logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Clearpassword didn't fullfill end entity profile.");                            throw new UserDoesntFullfillEndEntityProfile("Clearpassword didn't fullfill end entity profile.");             }            // Check if administrator is authorized to edit user.          if(!profileauthproxy.getEndEntityProfileAuthorization(admin, data.getEndEntityProfileId(),EndEntityProfileAuthorizationProxy.EDIT_RIGHTS)){            logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Administrator isn't authorized to change clearpassword.");                           throw new AuthorizationDeniedException("Administrator not authorized to edit user.");                    }          }                        try {            if (password == null){                data.setClearPassword("");                data.setTimeModified((new java.util.Date()).getTime());                logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_INFO_CHANGEDENDENTITY,"Clearpassword changed.");                                 }                else{                data.setOpenPassword(password);                data.setTimeModified((new java.util.Date()).getTime());                logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_INFO_CHANGEDENDENTITY,"Clearpassword changed.");                                 }            } catch (java.security.NoSuchAlgorithmException nsae)        {            debug("NoSuchAlgorithmException while setting password for user "+username);            throw new EJBException(nsae);        }        debug("<setClearTextPassword("+username+", hiddenpwd)");    } // setClearTextPassword