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;
}
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;
}
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;
}
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;
}
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);
}
Aggregations