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);
}
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");
}
}
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");
}
}
Aggregations