Search in sources :

Example 16 with SecurityManager

use of lucee.runtime.security.SecurityManager in project Lucee by lucee.

the class FileUpload method call.

public static Struct call(PageContext pc, String destination, String fileField, String accept, String nameConflict, String mode, String attributes, Object acl) throws PageException {
    SecurityManager securityManager = pc.getConfig().getSecurityManager();
    int nc = FileUtil.toNameConflict(nameConflict);
    int m = FileTag.toMode(mode);
    return FileTag.actionUpload(pc, securityManager, fileField, destination, nc, accept, true, m, attributes, acl, null);
}
Also used : SecurityManager(lucee.runtime.security.SecurityManager)

Example 17 with SecurityManager

use of lucee.runtime.security.SecurityManager in project Lucee by lucee.

the class ConfigWebUtil method checkGeneralWriteAccess.

public static void checkGeneralWriteAccess(ConfigImpl config, Password password) throws SecurityException {
    SecurityManager sm = config.getSecurityManager();
    short access = sm.getAccess(SecurityManager.TYPE_ACCESS_WRITE);
    if (config instanceof ConfigServer)
        access = SecurityManager.ACCESS_PROTECTED;
    if (access == SecurityManager.ACCESS_PROTECTED) {
        checkPassword(config, "write", password);
    } else if (access == SecurityManager.ACCESS_CLOSE) {
        throw new SecurityException("can't access, write access is disabled");
    }
}
Also used : SecurityManager(lucee.runtime.security.SecurityManager) SecurityException(lucee.runtime.exp.SecurityException)

Example 18 with SecurityManager

use of lucee.runtime.security.SecurityManager in project Lucee by lucee.

the class ConfigWebUtil method checkGeneralReadAccess.

public static void checkGeneralReadAccess(ConfigImpl config, Password password) throws SecurityException {
    SecurityManager sm = config.getSecurityManager();
    short access = sm.getAccess(SecurityManager.TYPE_ACCESS_READ);
    if (config instanceof ConfigServer)
        access = SecurityManager.ACCESS_PROTECTED;
    if (access == SecurityManager.ACCESS_PROTECTED) {
        checkPassword(config, "read", password);
    } else if (access == SecurityManager.ACCESS_CLOSE) {
        throw new SecurityException("can't access, read access is disabled");
    }
}
Also used : SecurityManager(lucee.runtime.security.SecurityManager) SecurityException(lucee.runtime.exp.SecurityException)

Aggregations

SecurityManager (lucee.runtime.security.SecurityManager)18 SecurityException (lucee.runtime.exp.SecurityException)7 ApplicationException (lucee.runtime.exp.ApplicationException)6 IOException (java.io.IOException)4 Element (org.w3c.dom.Element)4 FileResource (lucee.commons.io.res.type.file.FileResource)3 lucee.aprint (lucee.aprint)2 Resource (lucee.commons.io.res.Resource)2 AndResourceFilter (lucee.commons.io.res.filter.AndResourceFilter)2 DirectoryResourceFilter (lucee.commons.io.res.filter.DirectoryResourceFilter)2 FileResourceFilter (lucee.commons.io.res.filter.FileResourceFilter)2 NotResourceFilter (lucee.commons.io.res.filter.NotResourceFilter)2 OrResourceFilter (lucee.commons.io.res.filter.OrResourceFilter)2 ResourceFilter (lucee.commons.io.res.filter.ResourceFilter)2 ConfigServer (lucee.runtime.config.ConfigServer)2 ExpressionException (lucee.runtime.exp.ExpressionException)2 StructImpl (lucee.runtime.type.StructImpl)2 BufferedImage (java.awt.image.BufferedImage)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 MalformedURLException (java.net.MalformedURLException)1