use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateScriptProtect.
public void updateScriptProtect(String strScriptProtect) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update script protect");
Element scope = _getRootElement("application");
scope.setAttribute("script-protect", strScriptProtect.trim());
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateTypeChecking.
public void updateTypeChecking(Boolean typeChecking) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update");
Element datasources = _getRootElement("application");
if (typeChecking == null)
datasources.removeAttribute("type-checking");
else
datasources.setAttribute("type-checking", Caster.toString(typeChecking.booleanValue()));
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateClientCookies.
/**
* set if client cookies are enabled or not
* @param clientCookies
* @throws SecurityException
*/
public void updateClientCookies(Boolean clientCookies) 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("setclientcookies", Caster.toString(clientCookies, ""));
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updatePSQ.
/**
* update PSQ State
* @param psq Preserver Single Quote
* @throws SecurityException
*/
public void updatePSQ(Boolean psq) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DATASOURCE);
if (!hasAccess)
throw new SecurityException("no access to update datsource connections");
Element datasources = _getRootElement("data-sources");
datasources.setAttribute("psq", Caster.toString(psq, ""));
if (datasources.hasAttribute("preserve-single-quote"))
datasources.removeAttribute("preserve-single-quote");
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateDebugEntry.
public void updateDebugEntry(String type, String iprange, String label, String path, String fullname, Struct custom) throws SecurityException, IOException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
if (!hasAccess)
throw new SecurityException("no access to change debugging settings");
// leave this, this method throws a exception when ip range is not valid
IPRange.getInstance(iprange);
String id = MD5.getDigestAsString(label.trim().toLowerCase());
type = type.trim();
iprange = iprange.trim();
label = label.trim();
Element debugging = _getRootElement("debugging");
// Update
Element[] children = XMLConfigWebFactory.getChildren(debugging, "debug-entry");
Element el = null;
for (int i = 0; i < children.length; i++) {
String _id = children[i].getAttribute("id");
if (_id != null) {
if (_id.equals(id)) {
el = children[i];
break;
}
}
}
// Insert
if (el == null) {
el = doc.createElement("debug-entry");
debugging.appendChild(el);
el.setAttribute("id", id);
}
el.setAttribute("type", type);
el.setAttribute("iprange", iprange);
el.setAttribute("label", label);
el.setAttribute("path", path);
el.setAttribute("fullname", fullname);
el.setAttribute("custom", toStringURLStyle(custom));
}
Aggregations