Search in sources :

Example 51 with SecurityException

use of lucee.runtime.exp.SecurityException in project Lucee by lucee.

the class XMLConfigAdmin method updateErrorStatusCode.

public void updateErrorStatusCode(Boolean doStatusCode) throws SecurityException {
    checkWriteAccess();
    boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
    if (!hasAccess)
        throw new SecurityException("no access to change error settings");
    Element error = _getRootElement("error");
    error.setAttribute("status-code", Caster.toString(doStatusCode, ""));
}
Also used : Element(org.w3c.dom.Element) SecurityException(lucee.runtime.exp.SecurityException)

Example 52 with SecurityException

use of lucee.runtime.exp.SecurityException in project Lucee by lucee.

the class XMLConfigAdmin method updateApplicationListener.

public void updateApplicationListener(String type, String mode) throws SecurityException {
    checkWriteAccess();
    boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
    if (!hasAccess)
        throw new SecurityException("no access to update listener type");
    Element scope = _getRootElement("application");
    scope.setAttribute("listener-type", type.toLowerCase().trim());
    scope.setAttribute("listener-mode", mode.toLowerCase().trim());
}
Also used : Element(org.w3c.dom.Element) SecurityException(lucee.runtime.exp.SecurityException)

Example 53 with SecurityException

use of lucee.runtime.exp.SecurityException in project Lucee by lucee.

the class XMLConfigAdmin method updateBaseComponent.

/**
 * update the baseComponent
 * @param baseComponent
 * @throws SecurityException
 */
public void updateBaseComponent(String baseComponentCFML, String baseComponentLucee) throws SecurityException {
    checkWriteAccess();
    boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
    if (!hasAccess)
        throw new SecurityException("no access to update component setting");
    // config.resetBaseComponentPage();
    Element scope = _getRootElement("component");
    // if(baseComponent.trim().length()>0)
    scope.removeAttribute("base");
    scope.setAttribute("base-cfml", baseComponentCFML);
    scope.setAttribute("base-lucee", baseComponentLucee);
}
Also used : Element(org.w3c.dom.Element) SecurityException(lucee.runtime.exp.SecurityException)

Example 54 with SecurityException

use of lucee.runtime.exp.SecurityException in project Lucee by lucee.

the class XMLConfigAdmin method updateComponentDeepSearch.

public void updateComponentDeepSearch(Boolean deepSearch) throws SecurityException {
    checkWriteAccess();
    boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
    if (!hasAccess)
        throw new SecurityException("no access to update component setting");
    // config.resetBaseComponentPage();
    Element scope = _getRootElement("component");
    // if(baseComponent.trim().length()>0)
    if (deepSearch != null)
        scope.setAttribute("deep-search", Caster.toString(deepSearch.booleanValue()));
    else {
        if (scope.hasAttribute("deep-search"))
            scope.removeAttribute("deep-search");
    }
}
Also used : Element(org.w3c.dom.Element) SecurityException(lucee.runtime.exp.SecurityException)

Example 55 with SecurityException

use of lucee.runtime.exp.SecurityException in project Lucee by lucee.

the class XMLConfigAdmin method updateErrorTemplate.

/**
 * updates the ErrorTemplate
 * @param template
 * @throws SecurityException
 */
public void updateErrorTemplate(int statusCode, String template) throws SecurityException {
    checkWriteAccess();
    boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
    if (!hasAccess)
        throw new SecurityException("no access to change error settings");
    Element error = _getRootElement("error");
    // if(template.trim().length()>0)
    error.setAttribute("template-" + statusCode, template);
}
Also used : Element(org.w3c.dom.Element) SecurityException(lucee.runtime.exp.SecurityException)

Aggregations

SecurityException (lucee.runtime.exp.SecurityException)91 Element (org.w3c.dom.Element)83 ExpressionException (lucee.runtime.exp.ExpressionException)14 SecurityManager (lucee.runtime.security.SecurityManager)6 ApplicationException (lucee.runtime.exp.ApplicationException)5 IOException (java.io.IOException)4 Resource (lucee.commons.io.res.Resource)2 ClassException (lucee.commons.lang.ClassException)2 PageException (lucee.runtime.exp.PageException)2 ServiceException (coldfusion.server.ServiceException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 MalformedURLException (java.net.MalformedURLException)1 UnknownHostException (java.net.UnknownHostException)1 SQLException (java.sql.SQLException)1 Entry (java.util.Map.Entry)1 lucee.aprint (lucee.aprint)1 Cache (lucee.commons.io.cache.Cache)1 FileResourceProvider (lucee.commons.io.res.type.file.FileResourceProvider)1 CacheConnection (lucee.runtime.cache.CacheConnection)1 CFXTagException (lucee.runtime.cfx.CFXTagException)1