use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method resetORMSetting.
public void resetORMSetting() throws SecurityException {
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_ORM);
if (!hasAccess)
throw new SecurityException("no access to update ORM Settings");
Element orm = _getRootElement("orm");
orm.getParentNode().removeChild(orm);
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method setMailDefaultCharset.
/**
* sets the charset for the mail
* @param charset
* @throws SecurityException
*/
public void setMailDefaultCharset(String charset) throws PageException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL);
if (!hasAccess)
throw new SecurityException("no access to update mail server settings");
if (!StringUtil.isEmpty(charset)) {
try {
IOUtil.checkEncoding(charset);
} catch (IOException e) {
throw Caster.toPageException(e);
}
}
Element mail = _getRootElement("mail");
mail.setAttribute("default-encoding", charset);
// config.setMailDefaultEncoding(charset);
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateSessionTimeout.
/**
* updates session timeout value
* @param span
* @throws SecurityException
*/
public void updateSessionTimeout(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("sessiontimeout", span.getDay() + "," + span.getHour() + "," + span.getMinute() + "," + span.getSecond());
else
scope.removeAttribute("sessiontimeout");
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateStorage.
private void updateStorage(String storageName, String storage) throws SecurityException, ApplicationException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update scope setting");
storage = validateStorage(storage);
Element scope = _getRootElement("scope");
if (!StringUtil.isEmpty(storage, true))
scope.setAttribute(storageName + "storage", storage);
else
scope.removeAttribute(storageName + "storage");
}
use of lucee.runtime.exp.SecurityException in project Lucee by lucee.
the class XMLConfigAdmin method updateAllowURLRequestTimeout.
public void updateAllowURLRequestTimeout(Boolean allowURLRequestTimeout) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess)
throw new SecurityException("no access to update AllowURLRequestTimeout");
Element scope = _getRootElement("application");
scope.setAttribute("allow-url-requesttimeout", Caster.toString(allowURLRequestTimeout, ""));
}
Aggregations