Search in sources :

Example 71 with DbUserInfo

use of com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo in project cubrid-manager by CUBRID.

the class AddBackupPlanAction method isSupported.

public boolean isSupported(Object obj) {
    if (!(obj instanceof ISchemaNode)) {
        return false;
    }
    ISchemaNode node = (ISchemaNode) obj;
    CubridDatabase database = node.getDatabase();
    if (CubridNodeType.BACKUP_PLAN_FOLDER.equals(node.getType()) && database != null && database.isLogined()) {
        DbUserInfo dbUserInfo = database.getDatabaseInfo().getAuthLoginedDbUserInfo();
        if (dbUserInfo != null && dbUserInfo.isDbaAuthority()) {
            return true;
        }
    }
    return false;
}
Also used : DbUserInfo(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo) ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) CubridDatabase(com.cubrid.common.ui.spi.model.CubridDatabase)

Example 72 with DbUserInfo

use of com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo in project cubrid-manager by CUBRID.

the class AddQueryPlanAction method isSupported.

public boolean isSupported(Object obj) {
    if (!(obj instanceof ISchemaNode)) {
        return false;
    }
    ISchemaNode node = (ISchemaNode) obj;
    CubridDatabase database = node.getDatabase();
    if (CubridNodeType.QUERY_PLAN_FOLDER.equals(node.getType()) && database != null && database.isLogined()) {
        DbUserInfo dbUserInfo = database.getDatabaseInfo().getAuthLoginedDbUserInfo();
        if (dbUserInfo != null && dbUserInfo.isDbaAuthority()) {
            return true;
        }
    }
    return false;
}
Also used : DbUserInfo(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo) ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) CubridDatabase(com.cubrid.common.ui.spi.model.CubridDatabase)

Example 73 with DbUserInfo

use of com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo in project cubrid-manager by CUBRID.

the class AddVolumeAction method isSupported.

/**
	 * 
	 * @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java.lang.Object)
	 * @param obj the Object
	 * @return <code>true</code> if support this obj;<code>false</code>
	 *         otherwise
	 */
public boolean isSupported(Object obj) {
    if (obj instanceof ISchemaNode) {
        ISchemaNode node = (ISchemaNode) obj;
        CubridDatabase database = node.getDatabase();
        if (database != null && database.isLogined()) {
            DbUserInfo dbUserInfo = database.getDatabaseInfo().getAuthLoginedDbUserInfo();
            if (dbUserInfo != null && dbUserInfo.isDbaAuthority()) {
                return true;
            }
        }
    }
    return false;
}
Also used : DbUserInfo(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo) ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) CubridDatabase(com.cubrid.common.ui.spi.model.CubridDatabase)

Example 74 with DbUserInfo

use of com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo in project cubrid-manager by CUBRID.

the class SpaceFolderViewAction method isSupported.

/**
	 * Return whether this action support this object,if not support,this action
	 * will be disabled
	 * 
	 * @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
	 *      .lang.Object)
	 * @param obj the Object
	 * @return <code>true</code> if support this obj;<code>false</code>
	 *         otherwise
	 */
public boolean isSupported(Object obj) {
    if (obj instanceof ISchemaNode) {
        ISchemaNode node = (ISchemaNode) obj;
        CubridDatabase database = node.getDatabase();
        DbUserInfo dbUserInfo = database.getDatabaseInfo().getAuthLoginedDbUserInfo();
        String type = node.getType();
        if ((CubridNodeType.GENERIC_VOLUME_FOLDER.equals(type) || CubridNodeType.DATA_VOLUME_FOLDER.equals(type) || CubridNodeType.INDEX_VOLUME_FOLDER.equals(type) || CubridNodeType.TEMP_VOLUME_FOLDER.equals(type) || CubridNodeType.ACTIVE_LOG_FOLDER.equals(type) || CubridNodeType.ARCHIVE_LOG_FOLDER.equals(type)) && (dbUserInfo != null && database.isLogined())) {
            return true;
        }
    }
    return false;
}
Also used : DbUserInfo(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo) ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) CubridDatabase(com.cubrid.common.ui.spi.model.CubridDatabase)

Example 75 with DbUserInfo

use of com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo in project cubrid-manager by CUBRID.

the class IsDBAUserTaskTest method testExecuteTwo.

/**
	 * Test method for
	 * {@link com.cubrid.cubridmanager.core.cubrid.user.task.IsDBAUserTask#execute()}
	 * .
	 * 
	 * @throws SQLException
	 */
public void testExecuteTwo() {
    DbUserInfo userInfo = databaseInfo.getAuthLoginedDbUserInfo();
    String userName = userInfo.getName();
    userInfo.setName("other");
    checkTask.execute();
    assertTrue(checkTask.isDBAUser());
    userInfo.setName(userName);
}
Also used : DbUserInfo(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)

Aggregations

DbUserInfo (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)80 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)36 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)30 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)22 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)16 ArrayList (java.util.ArrayList)14 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)10 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)10 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)10 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)9 DbUserInfoList (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfoList)8 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)7 DatabaseEditorConfig (com.cubrid.common.ui.spi.model.DatabaseEditorConfig)6 ICubridNodeLoader (com.cubrid.common.ui.spi.model.ICubridNodeLoader)6 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)6 IsDBAUserTask (com.cubrid.cubridmanager.core.cubrid.user.task.IsDBAUserTask)6 CQBDbConnectionLoader (com.cubrid.cubridmanager.ui.spi.model.loader.CQBDbConnectionLoader)6 HashMap (java.util.HashMap)6 CubridNodeLoader (com.cubrid.common.ui.spi.model.CubridNodeLoader)5 UpdateCMUserTask (com.cubrid.cubridmanager.core.common.task.UpdateCMUserTask)5