Package railo.runtime.exp

Examples of railo.runtime.exp.SecurityException


      //print.ln("hasAccess:"+hasAccess);
      //print.ln("hasInsertAccess:"+hasInsertAccess);
       
        //boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManager.TYPE_DATASOURCE);
        if(!hasAccess)
            throw new SecurityException("no access to update datsource connections");
       
        // check parameters
        if(name==null || name.length()==0)
            throw new ExpressionException("name can't be a empty value");
       
        try {
      ClassUtil.loadInstance(clazzName);
    }
        catch (ClassException e) {
            throw new ExpressionException(e.getMessage());
    }
       
        Element datasources=_getRootElement("data-sources");
       
        // Update
        Element[] children = ConfigWebFactory.getChildren(datasources,"data-source");
        for(int i=0;i<children.length;i++) {
            String n=children[i].getAttribute("name");
           
            if(n.equalsIgnoreCase(name)) {
            Element el=children[i];
            if(password.equalsIgnoreCase("****************"))
                password=el.getAttribute("password");
             
            if(!StringUtil.isEmpty(newName) && !newName.equals(name))
              el.setAttribute("name",newName);
            el.setAttribute("class",clazzName);
            el.setAttribute("dsn",dsn);
            el.setAttribute("username",username);
            el.setAttribute("password",ConfigWebFactory.encrypt(password));

                el.setAttribute("host",host);
                if(!StringUtil.isEmpty(timezone))el.setAttribute("timezone",timezone);
                else if(el.hasAttribute("timezone")) el.removeAttribute("timezone");
                el.setAttribute("database",database);
                el.setAttribute("port",Caster.toString(port));
                el.setAttribute("connectionLimit",Caster.toString(connectionLimit));
                el.setAttribute("connectionTimeout",Caster.toString(connectionTimeout));
                el.setAttribute("metaCacheTimeout",Caster.toString(metaCacheTimeout));
                el.setAttribute("blob",Caster.toString(blob));
                el.setAttribute("clob",Caster.toString(clob));
                el.setAttribute("allow",Caster.toString(allow));
                el.setAttribute("validate",Caster.toString(validate));
                el.setAttribute("storage",Caster.toString(storage));
                el.setAttribute("custom",toStringURLStyle(custom));

              if (!StringUtil.isEmpty( dbdriver ))
                el.setAttribute("dbdriver", Caster.toString(dbdriver));

            return;
        }
        }
       
        if(!hasInsertAccess)
            throw new SecurityException("no access to add datasource connections, the maximum count of ["+maxLength+"] datasources is reached");
       
        // Insert
        Element el=doc.createElement("data-source");
        datasources.appendChild(el);
        if(!StringUtil.isEmpty(newName))
View Full Code Here


   
    checkWriteAccess();
      boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManagerImpl.TYPE_GATEWAY);
       
      if(!hasAccess)
            throw new SecurityException("no access to update gateway entry");
       
     
        // check parameters
        id=id.trim();
      if(StringUtil.isEmpty(id))
View Full Code Here

  public void updateCacheConnection(String name, String classname,int _default, Struct custom,boolean readOnly,boolean storage) throws PageException {
      checkWriteAccess();
      boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManagerImpl.TYPE_CACHE);
    if(!hasAccess)
            throw new SecurityException("no access to update cache connection");
       
     
        // check parameters
        name=name.trim();
      if(StringUtil.isEmpty(name))
View Full Code Here

  public void removeCacheDefaultConnection(int type) throws PageException {
      checkWriteAccess();
     
      boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManagerImpl.TYPE_CACHE);
        if(!hasAccess)
            throw new SecurityException("no access to update cache connections");
       
        Element parent=_getRootElement("cache");
        if(type==ConfigImpl.CACHE_DEFAULT_OBJECT){
          parent.removeAttribute("default-object");
        }
View Full Code Here

  public void updateCacheDefaultConnection(int type,String name) throws PageException {
      checkWriteAccess();
      boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManagerImpl.TYPE_CACHE);
       
      if(!hasAccess)
            throw new SecurityException("no access to update cache default connections");
       
        Element parent=_getRootElement("cache");
        if(type==ConfigImpl.CACHE_DEFAULT_OBJECT){
          parent.setAttribute("default-object", name);
        }
View Full Code Here

      boolean hasAccess=access==SecurityManager.VALUE_YES;
     
      String className=clazz.getName();
     
      if(!hasAccess)
            throw new SecurityException("no access to remove resources");
       
        Element parent=_getRootElement("resources");
       
        // remove
        Element[] children = ConfigWebFactory.getChildren(parent,"resource-provider");
View Full Code Here

      boolean hasAccess=access==SecurityManager.VALUE_YES;
     
      String className=clazz.getName();
     
      if(!hasAccess)
            throw new SecurityException("no access to update resources");
       
        // check parameters
      if(StringUtil.isEmpty(scheme))throw new ExpressionException("scheme can't be a empty value");
     
        Element parent=_getRootElement("resources");
View Full Code Here

      boolean hasAccess=access==SecurityManager.VALUE_YES;
     
      String className=clazz.getName();
     
      if(!hasAccess)
            throw new SecurityException("no access to update resources");
       
        Element parent=_getRootElement("resources");
       
        // Update
        Element[] children = ConfigWebFactory.getChildren(parent,"default-resource-provider");
View Full Code Here

  public void removeCacheConnection(String name) throws ExpressionException, SecurityException {
    checkWriteAccess();
   
    boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManagerImpl.TYPE_CACHE);
    if(!hasAccess)
            throw new SecurityException("no access to remove cache connection");
       
   
        // check parameters
        if(StringUtil.isEmpty(name))
            throw new ExpressionException("name for Cache Connection can be a empty value");
View Full Code Here

  public void removeCacheGatewayEntry(String name) throws PageException {
    checkWriteAccess();
       
    boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManagerImpl.TYPE_GATEWAY);
        if(!hasAccess)
            throw new SecurityException("no access to remove gateway entry");
       
        if(StringUtil.isEmpty(name))
            throw new ExpressionException("name for Gateway Id can be a empty value");
       
        Element parent=_getRootElement("gateways");
View Full Code Here

TOP

Related Classes of railo.runtime.exp.SecurityException

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.