Search in sources :

Example 6 with IEEUser

use of org.pentaho.di.repository.pur.model.IEEUser in project pentaho-kettle by pentaho.

the class UserRoleHelper method convertFromProxyPentahoUser.

public static IUser convertFromProxyPentahoUser(IUserRoleWebService userRoleWebService, ProxyPentahoUser user, UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm) {
    IUser userInfo = null;
    try {
        userInfo = rsm.constructUser();
        userInfo.setDescription(user.getDescription());
        userInfo.setPassword(user.getPassword());
        userInfo.setLogin(user.getName());
        userInfo.setName(user.getName());
        try {
            if (userInfo instanceof IEEUser) {
                ((IEEUser) userInfo).setRoles(convertToSetFromProxyPentahoRoles(userRoleWebService.getRolesForUser(user), lookupCache));
            }
        } catch (UserRoleException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    } catch (KettleException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    return userInfo;
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) IUser(org.pentaho.di.repository.IUser) UserRoleException(org.pentaho.platform.security.userroledao.ws.UserRoleException) IEEUser(org.pentaho.di.repository.pur.model.IEEUser)

Example 7 with IEEUser

use of org.pentaho.di.repository.pur.model.IEEUser in project pentaho-kettle by pentaho.

the class UserRoleLookupCache method updateUserInLookupSet.

public void updateUserInLookupSet(IUser user) {
    IUser userInfoToUpdate = null;
    for (IUser userInfo : userInfoSet) {
        if (userInfo.getLogin().equals(user.getLogin())) {
            userInfoToUpdate = userInfo;
            break;
        }
    }
    userInfoToUpdate.setDescription(user.getDescription());
    if (!StringUtils.isEmpty(user.getPassword())) {
        userInfoToUpdate.setPassword(user.getPassword());
    }
    if (user instanceof IEEUser) {
        ((IEEUser) userInfoToUpdate).setRoles(((IEEUser) user).getRoles());
    }
}
Also used : IUser(org.pentaho.di.repository.IUser) IEEUser(org.pentaho.di.repository.pur.model.IEEUser)

Aggregations

IEEUser (org.pentaho.di.repository.pur.model.IEEUser)7 KettleException (org.pentaho.di.core.exception.KettleException)5 IUser (org.pentaho.di.repository.IUser)5 UserRoleException (org.pentaho.platform.security.userroledao.ws.UserRoleException)3 JSONException (org.json.JSONException)2 ProxyPentahoUser (org.pentaho.platform.security.userroledao.ws.ProxyPentahoUser)2 IUIEEUser (org.pentaho.di.ui.repository.pur.repositoryexplorer.IUIEEUser)1 IUIRole (org.pentaho.di.ui.repository.pur.repositoryexplorer.IUIRole)1 IUIUser (org.pentaho.di.ui.repository.repositoryexplorer.model.IUIUser)1