use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class ExecuteSqlLogAction method isSupported.
/**
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
* @param obj Object
* @return boolean
*/
public boolean isSupported(Object obj) {
if (obj instanceof ICubridNode) {
ICubridNode node = (ICubridNode) obj;
if (node.getServer() == null) {
return false;
}
ServerUserInfo serverUserInfo = node.getServer().getServerInfo().getLoginedUserInfo();
if (serverUserInfo == null || serverUserInfo.getCasAuth() != CasAuthType.AUTH_ADMIN) {
return false;
}
if (CubridNodeType.BROKER_SQL_LOG.equals(node.getType())) {
return true;
}
}
return false;
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class RemoveAllScriptLogAction method isSupported.
/**
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
* @param obj Object
* @return boolean(whether to support)
*/
public boolean isSupported(Object obj) {
if (obj instanceof ICubridNode) {
ICubridNode node = (ICubridNode) obj;
if (node.getServer() == null) {
return false;
}
ServerUserInfo serverUserInfo = node.getServer().getServerInfo().getLoginedUserInfo();
if (serverUserInfo == null || serverUserInfo.getCasAuth() != CasAuthType.AUTH_ADMIN) {
return false;
}
if (CubridNodeType.BROKER_SQL_LOG_FOLDER.equals(node.getType())) {
return true;
}
}
return false;
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class RemoveLogAction method isSupported.
/**
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
* @param obj Object
* @return boolean(whether to support)
*/
public boolean isSupported(Object obj) {
if (obj instanceof Object[]) {
return true;
}
if (!(obj instanceof ICubridNode)) {
return false;
}
ICubridNode node = (ICubridNode) obj;
if (node.getServer() == null) {
return false;
}
ServerUserInfo serverUserInfo = node.getServer().getServerInfo().getLoginedUserInfo();
String type = node.getType();
if (CubridNodeType.BROKER_SQL_LOG.equals(type)) {
if (serverUserInfo == null || serverUserInfo.getCasAuth() != CasAuthType.AUTH_ADMIN) {
return false;
}
return true;
} else if (CubridNodeType.LOGS_BROKER_ACCESS_LOG.equals(type) || CubridNodeType.LOGS_BROKER_ERROR_LOG.equals(type) || CubridNodeType.LOGS_SERVER_DATABASE_LOG.equals(type)) {
if (serverUserInfo == null || !serverUserInfo.isAdmin()) {
return false;
}
if (CubridNodeType.LOGS_SERVER_DATABASE_LOG.equals(type) && isLastDbServerLog(node)) {
return false;
}
return true;
}
return false;
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class RemoveAllErrorLogAction method isSupported.
/**
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
* @param obj Object
* @return boolean(whether to support)
*/
public boolean isSupported(Object obj) {
if (obj instanceof ICubridNode) {
ICubridNode node = (ICubridNode) obj;
if (node.getServer() == null) {
return false;
}
ServerUserInfo serverUserInfo = node.getServer().getServerInfo().getLoginedUserInfo();
if (serverUserInfo == null || !serverUserInfo.isAdmin()) {
return false;
}
if (CubridNodeType.LOGS_BROKER_ERROR_LOG_FOLDER.equals(node.getType())) {
return true;
}
}
return false;
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class RemoveAllManagerLogAction method isSupported.
/**
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
* @param obj Object
* @return boolean(whether to support)
*/
public boolean isSupported(Object obj) {
if (obj instanceof ICubridNode) {
ICubridNode node = (ICubridNode) obj;
if (node.getServer() == null) {
return false;
}
ServerUserInfo serverUserInfo = node.getServer().getServerInfo().getLoginedUserInfo();
if (serverUserInfo == null || !serverUserInfo.isAdmin()) {
return false;
}
if (CubridNodeType.LOGS_MANAGER_ACCESS_LOG.equals(node.getType()) || CubridNodeType.LOGS_MANAGER_ERROR_LOG.equals(node.getType())) {
return true;
}
}
return false;
}
Aggregations