Package railo.runtime.security

Examples of railo.runtime.security.SecurityManager


    public void updateDataSource(String name, String newName, String clazzName, String dsn, String username, String password,
            String host, String database, int port, int connectionLimit, int connectionTimeout, long metaCacheTimeout,
            boolean blob, boolean clob, int allow, boolean validate, boolean storage, String timezone, Struct custom, String dbdriver) throws ExpressionException, SecurityException {

      checkWriteAccess();
      SecurityManager sm = config.getSecurityManager();
      short access = sm.getAccess(SecurityManager.TYPE_DATASOURCE);
      boolean hasAccess=true;
      boolean hasInsertAccess=true;
      int maxLength=0;
     
      if(access==SecurityManager.VALUE_YES) hasAccess=true;
View Full Code Here


        }
    }
 
    public void removeResourceProvider(Class clazz) throws PageException {
      checkWriteAccess();
      SecurityManager sm = config.getSecurityManager();
      short access = sm.getAccess(SecurityManager.TYPE_FILE);
      boolean hasAccess=access==SecurityManager.VALUE_YES;
     
      String className=clazz.getName();
     
      if(!hasAccess)
View Full Code Here

      updateResourceProvider(scheme, clazz, toStringCSSStyle(arguments));
    }

  public void updateResourceProvider(String scheme, Class clazz,String arguments) throws PageException {
      checkWriteAccess();
      SecurityManager sm = config.getSecurityManager();
      short access = sm.getAccess(SecurityManager.TYPE_FILE);
      boolean hasAccess=access==SecurityManager.VALUE_YES;
     
      String className=clazz.getName();
     
      if(!hasAccess)
View Full Code Here

      el.setAttribute("class",className);
 
 
  public void updateDefaultResourceProvider(Class clazz, String arguments) throws PageException {
      checkWriteAccess();
      SecurityManager sm = config.getSecurityManager();
      short access = sm.getAccess(SecurityManager.TYPE_FILE);
      boolean hasAccess=access==SecurityManager.VALUE_YES;
     
      String className=clazz.getName();
     
      if(!hasAccess)
View Full Code Here

        if(m.hasPhysical())id.append(m.getStrPhysical());
        if(m.hasArchive())id.append(m.getStrPhysical());
        return m.toString().toLowerCase();
  }
  public static void checkGeneralReadAccess(ConfigImpl config, String 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) {
View Full Code Here

        throw new SecurityException("can't access, read access is disabled");
      }
  }
 
  public static void checkGeneralWriteAccess(ConfigImpl config, String 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);
      }
View Full Code Here

   * @throws PageException
   */
  public static Object actionList(PageContext pageContext,Resource directory, String serverPassword, int type,ResourceFilter filter,ResourceAndResourceNameFilter nameFilter,
      int listInfo,boolean recurse,String sort) throws PageException {
    // check directory
    SecurityManager securityManager = pageContext.getConfig().getSecurityManager();
    securityManager.checkFileLocation(pageContext.getConfig(),directory,serverPassword);
     
      if(type!=TYPE_ALL) {
        ResourceFilter typeFilter = (type==TYPE_DIR)?DIRECTORY_FILTER:FILE_FILTER;
        if(filter==null) filter=typeFilter;
        else filter=new AndResourceFilter(new ResourceFilter[]{typeFilter,filter});
View Full Code Here

   * create a directory
   * @throws PageException
   */
    public static void actionCreate(PageContext pc,Resource directory,String serverPassword, boolean createPath, int mode, Object acl, int storage, int nameConflict) throws PageException {

      SecurityManager securityManager = pc.getConfig().getSecurityManager();
      securityManager.checkFileLocation(pc.getConfig(),directory,serverPassword);
     
    if(directory.exists()) {
      if(directory.isDirectory()) {
        if ( nameConflict == NAMECONFLICT_SKIP )
          return;
View Full Code Here

   * @param dir
   * @param forceDelete
   * @throws PageException
   */
  public static void actionDelete(PageContext pc,Resource dir, boolean forceDelete,String serverPassword) throws PageException {
    SecurityManager securityManager = pc.getConfig().getSecurityManager();
      securityManager.checkFileLocation(pc.getConfig(),dir,serverPassword);
     
    // directory doesn't exist
    if(!dir.exists()) {
      if(dir.isDirectory())
        throw new ApplicationException("directory ["+dir.toString()+"] doesn't exist");
View Full Code Here

   * rename a directory to a new Name
   * @throws PageException
   */
  public static  void actionRename(PageContext pc,Resource directory,String strNewdirectory,String serverPassword, boolean createPath, Object acl,int storage) throws PageException {
    // check directory
    SecurityManager securityManager = pc.getConfig().getSecurityManager();
      securityManager.checkFileLocation(pc.getConfig(),directory,serverPassword);
   
     
    if(!directory.exists())
      throw new ApplicationException("the directory ["+directory.toString()+"] doesn't exist");
    if(!directory.isDirectory())
      throw new ApplicationException("the file ["+directory.toString()+"] exists, but it isn't a directory");
    if(!directory.canRead())
      throw new ApplicationException("no access to read directory ["+directory.toString()+"]");
   
    if(strNewdirectory==null)
      throw new ApplicationException("the attribute [newDirectory] is not defined");
   
    // real to source
    Resource newdirectory=toDestination(pc,strNewdirectory,directory);
   
      securityManager.checkFileLocation(pc.getConfig(),newdirectory,serverPassword);
    if(newdirectory.exists())
      throw new ApplicationException("new directory ["+newdirectory.toString()+"] already exists");
    if(createPath) {
      newdirectory.getParentResource().mkdirs();
     
View Full Code Here

TOP

Related Classes of railo.runtime.security.SecurityManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.