use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class UserRoleHelper method convertFromProxyPentahoUser.
public static IUser convertFromProxyPentahoUser(ProxyPentahoUser user, List<UserToRoleAssignment> assignments, 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());
if (userInfo instanceof IEEUser) {
((IEEUser) userInfo).setRoles(getRolesForUser(user.getName(), assignments, rsm));
}
} catch (KettleException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return userInfo;
}
use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class UserRoleHelper method convertToPentahoProxyUsers.
public static ProxyPentahoUser[] convertToPentahoProxyUsers(Set<IUser> users) {
ProxyPentahoUser[] proxyUsers = new ProxyPentahoUser[users.size()];
int i = 0;
for (IUser user : users) {
proxyUsers[i++] = convertToPentahoProxyUser(user);
}
return proxyUsers;
}
use of org.pentaho.di.repository.IUser 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;
}
use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class UserRoleHelper method convertToPentahoProxyUsers.
public static ProxyPentahoUser[] convertToPentahoProxyUsers(List<IUser> users) {
ProxyPentahoUser[] proxyUsers = new ProxyPentahoUser[users.size()];
int i = 0;
for (IUser user : users) {
proxyUsers[i++] = convertToPentahoProxyUser(user);
}
return proxyUsers;
}
use of org.pentaho.di.repository.IUser 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());
}
}
Aggregations