railo.runtime.security
Class SecurityManagerImpl

java.lang.Object
  extended by railo.runtime.security.SecurityManagerImpl
All Implemented Interfaces:
Cloneable, SecurityManager

public final class SecurityManagerImpl
extends Object
implements Cloneable, SecurityManager

SecurityManager to control access to different services


Field Summary
static int TYPE_CACHE
           
static int TYPE_GATEWAY
           
static int TYPE_ORM
           
 
Fields inherited from interface railo.runtime.security.SecurityManager
ACCESS_CLOSE, ACCESS_OPEN, ACCESS_PROTECTED, NUMBER_OFFSET, TYPE_ACCESS_READ, TYPE_ACCESS_WRITE, TYPE_CFX_SETTING, TYPE_CFX_USAGE, TYPE_CUSTOM_TAG, TYPE_DATASOURCE, TYPE_DEBUGGING, TYPE_DIRECT_JAVA_ACCESS, TYPE_FILE, TYPE_MAIL, TYPE_MAPPING, TYPE_REMOTE, TYPE_SCHEDULED_TASK, TYPE_SEARCH, TYPE_SETTING, TYPE_TAG_EXECUTE, TYPE_TAG_IMPORT, TYPE_TAG_OBJECT, TYPE_TAG_REGISTRY, VALUE_1, VALUE_10, VALUE_2, VALUE_3, VALUE_4, VALUE_5, VALUE_6, VALUE_7, VALUE_8, VALUE_9, VALUE_ALL, VALUE_LOCAL, VALUE_NO, VALUE_NONE, VALUE_YES
 
Constructor Summary
SecurityManagerImpl(short setting, short file, short directJavaAccess, short mail, short datasource, short mapping, short remote, short customTag, short cfxSetting, short cfxUsage, short debugging, short search, short scheduledTasks, short tagExecute, short tagImport, short tagObject, short tagRegistry, short cache, short gateway, short orm, short accessRead, short accessWrite)
          create a new Accessor
 
Method Summary
 void checkFileLocation(Config config, Resource res, String serverPassword)
           
 void checkFileLocation(Resource res)
           
 Object clone()
           
 SecurityManager cloneSecurityManager()
           
 short getAccess(int access)
           
 short getAccess(String access)
           
 Resource[] getCustomFileAccess()
           
static SecurityManager getOpenSecurityManager()
           
 void setAccess(int access, short value)
           
 void setCustomFileAccess(Resource[] fileAccess)
           
 void setRootDirectory(Resource rootDirectory)
           
static short toShortAccessRWValue(String accessValue)
           
static short toShortAccessRWValue(String accessValue, short defaultValue)
           
static short toShortAccessValue(String accessValue)
          translate a string access value (all,local,none,no,yes) to int type
static short toShortAccessValue(String accessValue, short defaultValue)
          translate a string access value (all,local,none,no,yes) to int type
static String toStringAccessRWValue(short accessValue)
           
static String toStringAccessValue(short accessValue)
          translate a short access value (all,local,none,no,yes) to String type
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_CACHE

public static final int TYPE_CACHE
See Also:
Constant Field Values

TYPE_GATEWAY

public static final int TYPE_GATEWAY
See Also:
Constant Field Values

TYPE_ORM

public static final int TYPE_ORM
See Also:
Constant Field Values
Constructor Detail

SecurityManagerImpl

public SecurityManagerImpl(short setting,
                           short file,
                           short directJavaAccess,
                           short mail,
                           short datasource,
                           short mapping,
                           short remote,
                           short customTag,
                           short cfxSetting,
                           short cfxUsage,
                           short debugging,
                           short search,
                           short scheduledTasks,
                           short tagExecute,
                           short tagImport,
                           short tagObject,
                           short tagRegistry,
                           short cache,
                           short gateway,
                           short orm,
                           short accessRead,
                           short accessWrite)
create a new Accessor

Parameters:
setting -
file -
directJavaAccess -
mail -
datasource -
mapping -
customTag -
cfxSetting -
cfxUsage -
debugging -
search -
scheduledTasks -
tagExecute -
tagImport -
tagObject -
tagRegistry -
t -
accessRead -
Method Detail

getOpenSecurityManager

public static SecurityManager getOpenSecurityManager()
Returns:
return default accessor (no restriction)

getAccess

public short getAccess(int access)
Specified by:
getAccess in interface SecurityManager
Returns:
return access value (all,local,none ...) for given type (cfx,file ...)
See Also:
SecurityManager.getAccess(int)

setAccess

public void setAccess(int access,
                      short value)

getAccess

public short getAccess(String access)
                throws SecurityException
Specified by:
getAccess in interface SecurityManager
Returns:
return access value (all,local,none ...) for given type (cfx,file ...)
Throws:
SecurityException
See Also:
SecurityManager.getAccess(java.lang.String)

toShortAccessValue

public static short toShortAccessValue(String accessValue)
                                throws SecurityException
translate a string access value (all,local,none,no,yes) to int type

Parameters:
accessValue -
Returns:
return int access value (VALUE_ALL,VALUE_LOCAL,VALUE_NO,VALUE_NONE,VALUE_YES)
Throws:
SecurityException

toShortAccessRWValue

public static short toShortAccessRWValue(String accessValue)
                                  throws SecurityException
Throws:
SecurityException

toShortAccessValue

public static short toShortAccessValue(String accessValue,
                                       short defaultValue)
translate a string access value (all,local,none,no,yes) to int type

Parameters:
accessValue -
defaultValue - when accessValue is invlaid this value will be returned
Returns:
return int access value (VALUE_ALL,VALUE_LOCAL,VALUE_NO,VALUE_NONE,VALUE_YES)

toShortAccessRWValue

public static short toShortAccessRWValue(String accessValue,
                                         short defaultValue)

toStringAccessValue

public static String toStringAccessValue(short accessValue)
                                  throws SecurityException
translate a short access value (all,local,none,no,yes) to String type

Parameters:
accessValue -
Returns:
return int access value (VALUE_ALL,VALUE_LOCAL,VALUE_NO,VALUE_NONE,VALUE_YES)
Throws:
SecurityException

toStringAccessRWValue

public static String toStringAccessRWValue(short accessValue)
                                    throws SecurityException
Throws:
SecurityException

checkFileLocation

public void checkFileLocation(Resource res)
                       throws SecurityException
Specified by:
checkFileLocation in interface SecurityManager
Throws:
SecurityException
See Also:
railo.runtime.security.SecurityManager#checkFileLocation(railo.commons.io.res.Resource, java.lang.String)

checkFileLocation

public void checkFileLocation(Config config,
                              Resource res,
                              String serverPassword)
                       throws SecurityException
Specified by:
checkFileLocation in interface SecurityManager
Throws:
SecurityException

cloneSecurityManager

public SecurityManager cloneSecurityManager()
Specified by:
cloneSecurityManager in interface SecurityManager
Returns:
clone the security Manager
See Also:
railo.runtime.security.ISecurityManager#cloneSecurityManager()

clone

public Object clone()
Overrides:
clone in class Object
See Also:
Object.clone()

getCustomFileAccess

public Resource[] getCustomFileAccess()

setCustomFileAccess

public void setCustomFileAccess(Resource[] fileAccess)

setRootDirectory

public void setRootDirectory(Resource rootDirectory)


Copyright © 2012 Railo