Search in sources :

Example 31 with IUser

use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.

the class UserRoleLookupCache method addUserToLookupSet.

private IUser addUserToLookupSet(ProxyPentahoUser user) {
    IUser userInfo = createUserInfo(user);
    userInfoSet.add(userInfo);
    return userInfo;
}
Also used : IUser(org.pentaho.di.repository.IUser)

Example 32 with IUser

use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.

the class UISecurityUser method getUserInfo.

public IUser getUserInfo() throws KettleException {
    IUser userInfo = rsm.constructUser();
    userInfo.setDescription(description);
    userInfo.setLogin(name);
    userInfo.setName(name);
    userInfo.setUsername(name);
    userInfo.setPassword(password);
    return userInfo;
}
Also used : IUser(org.pentaho.di.repository.IUser)

Example 33 with IUser

use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.

the class RepositoryExplorerDialog method newUser.

public void newUser() {
    UserDialog ud = new UserDialog(shell, SWT.NONE, rep, new UserInfo());
    IUser ui = ud.open();
    if (ui != null) {
        /**
         *************************
         * Removed by sboden as the user dialog already saves the id on pressing ok. Related defect #4228 on javaforge.
         *
         * // See if this user already exists... long uid = rep.getUserID(ui.getLogin()); if (uid<=0) { ui.saveRep(rep); }
         * else { MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
         * mb.setMessage(BaseMessages.getString(PKG, "RepositoryExplorerDialog.User.New.AlreadyExists.Message"));
         * mb.setText(BaseMessages.getString(PKG, "RepositoryExplorerDialog.User.New.AlreadyExists.Title")); mb.open(); }
         ***************************
         */
        // Refresh tree...
        refreshTree();
    }
}
Also used : IUser(org.pentaho.di.repository.IUser) UserInfo(org.pentaho.di.repository.UserInfo)

Example 34 with IUser

use of org.pentaho.di.repository.IUser in project pentaho-kettle by pentaho.

the class RepositoryExplorerDialog method editUser.

public void editUser(String login) {
    try {
        // Get UserInfo from repository...
        IUser uinfo = securityManager.loadUserInfo(login);
        UserDialog ud = new UserDialog(shell, SWT.NONE, rep, uinfo);
        IUser ui = ud.open();
        if (!readonly) {
            if (ui != null) {
                securityManager.saveUserInfo(ui);
            }
        } else {
            MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
            mb.setMessage(BaseMessages.getString(PKG, "RepositoryExplorerDialog.User.Edit.NotAllowed.Message"));
            mb.setText(BaseMessages.getString(PKG, "RepositoryExplorerDialog.User.Edit.NotAllowed.Title"));
            mb.open();
        }
        if (ui != null && !login.equalsIgnoreCase(ui.getLogin())) {
            refreshTree();
        }
    } catch (KettleException e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.User.Edit.UnexpectedError.Message.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.User.Edit.UnexpectedError.Message"), e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) IUser(org.pentaho.di.repository.IUser) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) MessageBox(org.eclipse.swt.widgets.MessageBox)

Aggregations

IUser (org.pentaho.di.repository.IUser)34 KettleException (org.pentaho.di.core.exception.KettleException)12 Test (org.junit.Test)8 ProxyPentahoUser (org.pentaho.platform.security.userroledao.ws.ProxyPentahoUser)7 UserInfo (org.pentaho.di.repository.UserInfo)6 IEEUser (org.pentaho.di.repository.pur.model.IEEUser)5 IRoleSupportSecurityManager (org.pentaho.di.ui.repository.pur.services.IRoleSupportSecurityManager)5 ArrayList (java.util.ArrayList)4 EEUserInfo (org.pentaho.di.repository.pur.model.EEUserInfo)3 IUIUser (org.pentaho.di.ui.repository.repositoryexplorer.model.IUIUser)3 UserRoleException (org.pentaho.platform.security.userroledao.ws.UserRoleException)3 HashSet (java.util.HashSet)2 JSONException (org.json.JSONException)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 UserRoleHelper.convertFromProxyPentahoUser (org.pentaho.di.repository.pur.UserRoleHelper.convertFromProxyPentahoUser)2 IRole (org.pentaho.di.repository.pur.model.IRole)2 IUIRole (org.pentaho.di.ui.repository.pur.repositoryexplorer.IUIRole)2 UserRoleSecurityInfo (org.pentaho.platform.security.userroledao.ws.UserRoleSecurityInfo)2 UserToRoleAssignment (org.pentaho.platform.security.userroledao.ws.UserToRoleAssignment)2 IRepositorySyncWebService (com.pentaho.pdi.ws.IRepositorySyncWebService)1