use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateDefaultResourceProvider.
public void updateDefaultResourceProvider(ClassDefinition cd, String arguments) throws PageException {
checkWriteAccess();
SecurityManager sm = config.getSecurityManager();
short access = sm.getAccess(SecurityManager.TYPE_FILE);
boolean hasAccess = access == SecurityManager.VALUE_YES;
if (!hasAccess)
throw new SecurityException("no access to update resources");
Element parent = _getRootElement("resources");
// Update
Element[] children = XMLConfigWebFactory.getChildren(parent, "default-resource-provider");
for (int i = 0; i < children.length; i++) {
Element el = children[i];
el.setAttribute("arguments", arguments);
return;
}
// Insert
Element el = doc.createElement("default-resource-provider");
parent.appendChild(el);
el.setAttribute("arguments", arguments);
setClass(el, null, "", cd);
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateApplicationTimeout.
/**
* updates request timeout value
* @param span
* @throws SecurityException
*/
public void updateApplicationTimeout(TimeSpan span) 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("scope");
if (span != null)
scope.setAttribute("applicationtimeout", span.getDay() + "," + span.getHour() + "," + span.getMinute() + "," + span.getSecond());
else
scope.removeAttribute("applicationtimeout");
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateLocalMode.
public void updateLocalMode(String mode) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update scope setting");
mode = mode.toLowerCase().trim();
Element scope = _getRootElement("scope");
scope.setAttribute("local-mode", mode);
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateComponentUseShadow.
public void updateComponentUseShadow(Boolean useShadow) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update use-shadow");
Element scope = _getRootElement("component");
scope.setAttribute("use-shadow", Caster.toString(useShadow, ""));
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateClientManagement.
/**
* enable or desable client management
* @param clientManagement
* @throws SecurityException
*/
public void updateClientManagement(Boolean clientManagement) 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("scope");
scope.setAttribute("clientmanagement", Caster.toString(clientManagement, ""));
}
Aggregations