use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateComponentDumpTemplate.
/**
* updates the DebugTemplate
* @param template
* @throws SecurityException
*/
public void updateComponentDumpTemplate(String template) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update component setting");
Element component = _getRootElement("component");
// if(template.trim().length()>0)
component.setAttribute("dump-template", template);
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method removeRemoteClient.
public void removeRemoteClient(String url) throws ExpressionException, SecurityException {
checkWriteAccess();
// SNSN
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_REMOTE);
if (!hasAccess)
throw new SecurityException("no access to remove remote client settings");
// check parameters
if (StringUtil.isEmpty(url))
throw new ExpressionException("url for Remote Client can be a empty value");
Element clients = _getRootElement("remote-clients");
Element[] children = XMLConfigWebFactory.getChildren(clients, "remote-client");
for (int i = 0; i < children.length; i++) {
String n = children[i].getAttribute("url");
if (n != null && n.equalsIgnoreCase(url)) {
clients.removeChild(children[i]);
}
}
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateCustomTagDeepSearch.
public void updateCustomTagDeepSearch(boolean customTagDeepSearch) throws SecurityException {
checkWriteAccess();
if (!ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG))
throw new SecurityException("no access to update custom tag setting");
Element element = _getRootElement("custom-tag");
element.setAttribute("custom-tag-deep-search", Caster.toString(customTagDeepSearch));
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateSuppressContent.
/*public void updateSuppressWhitespace(Boolean value) throws SecurityException {
checkWriteAccess();
boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManager.TYPE_SETTING);
if(!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope=_getRootElement("setting");
scope.setAttribute("suppress-whitespace",Caster.toString(value,""));
}*/
public void updateSuppressContent(Boolean value) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("setting");
scope.setAttribute("suppress-content", Caster.toString(value, ""));
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method removeCacheDefaultConnection.
public void removeCacheDefaultConnection(int type) throws PageException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE);
if (!hasAccess)
throw new SecurityException("no access to update cache connections");
Element parent = _getRootElement("cache");
if (type == ConfigImpl.CACHE_TYPE_OBJECT) {
parent.removeAttribute("default-object");
} else if (type == ConfigImpl.CACHE_TYPE_TEMPLATE) {
parent.removeAttribute("default-template");
} else if (type == ConfigImpl.CACHE_TYPE_QUERY) {
parent.removeAttribute("default-query");
} else if (type == ConfigImpl.CACHE_TYPE_RESOURCE) {
parent.removeAttribute("default-resource");
} else if (type == ConfigImpl.CACHE_TYPE_FUNCTION) {
parent.removeAttribute("default-function");
} else if (type == ConfigImpl.CACHE_TYPE_INCLUDE) {
parent.removeAttribute("default-include");
} else if (type == ConfigImpl.CACHE_TYPE_HTTP) {
parent.removeAttribute("default-http");
} else if (type == ConfigImpl.CACHE_TYPE_FILE) {
parent.removeAttribute("default-file");
} else if (type == ConfigImpl.CACHE_TYPE_WEBSERVICE) {
parent.removeAttribute("default-webservice");
}
}
Aggregations