use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class PurRepositorySecurityManagerTest method saveUserInfo_NormalizesInfo_PassesIfNoViolations.
@Test
public void saveUserInfo_NormalizesInfo_PassesIfNoViolations() throws Exception {
IUser info = new UserInfo("login ");
ArgumentCaptor<IUser> captor = ArgumentCaptor.forClass(IUser.class);
manager.saveUserInfo(info);
verify(roleDelegate).createUser(captor.capture());
info = captor.getValue();
assertEquals("Spaces should be trimmed", "login", info.getLogin());
}
use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class UIEESecurityUser method getUserInfo.
@Override
public IUser getUserInfo() throws KettleException {
IUser userInfo = rsm.constructUser();
userInfo.setDescription(getDescription());
userInfo.setLogin(getName());
userInfo.setName(getName());
userInfo.setUsername(getName());
userInfo.setPassword(getPassword());
if (userInfo instanceof IEEUser) {
for (IUIRole role : getAssignedRoles()) {
((IEEUser) userInfo).addRole(role.getRole());
}
}
return userInfo;
}
use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class PurRepositorySecurityManager method loadUserInfo.
public IUser loadUserInfo(String login, String password) throws KettleException {
// Create a UserInfo object
IUser user = constructUser();
user.setLogin(login);
user.setPassword(password);
user.setName(login);
return user;
}
use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class UserRoleDelegate method updateRole.
public void updateRole(IRole role) throws KettleException {
ensureHasPermissions();
try {
List<String> users = new ArrayList<String>();
for (IUser user : role.getUsers()) {
users.add(user.getLogin());
}
userRoleWebService.updateRole(role.getName(), role.getDescription(), users);
lookupCache.updateRoleInLookupSet(role);
fireUserRoleListChange();
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(UserRoleDelegate.class, "UserRoleDelegate.ERROR_0012_UNABLE_TO_UPDATE_ROLE", role.getName()), // $NON-NLS-1$
e);
}
}
use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.
the class UserRoleHelper method convertToUserInfo.
public static IUser convertToUserInfo(ProxyPentahoUser user, ProxyPentahoRole[] roles, 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(convertToSetFromProxyPentahoRoles(roles, rsm));
}
} catch (KettleException ke) {
ke.printStackTrace();
}
return userInfo;
}
Aggregations