Package railo.runtime.exp

Examples of railo.runtime.exp.SecurityException


    public void updateSessionManagement(Boolean sessionManagement) throws SecurityException {
      checkWriteAccess();
        boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManager.TYPE_SETTING);
       
        if(!hasAccess)
            throw new SecurityException("no access to update scope setting");
       
        Element scope=_getRootElement("scope");
        scope.setAttribute("sessionmanagement",Caster.toString(sessionManagement,""));
    }
View Full Code Here


    public void updateClientManagement(Boolean clientManagement) throws SecurityException {
      checkWriteAccess();
        boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManager.TYPE_SETTING);
       
        if(!hasAccess)
            throw new SecurityException("no access to update scope setting");
       
        Element scope=_getRootElement("scope");
        scope.setAttribute("clientmanagement",Caster.toString(clientManagement,""));
    }
View Full Code Here

     */
    public void updateClientCookies(Boolean clientCookies) throws SecurityException {
      checkWriteAccess();
        boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManager.TYPE_SETTING);
        if(!hasAccess)
            throw new SecurityException("no access to update scope setting");
       
        Element scope=_getRootElement("scope");
        scope.setAttribute("setclientcookies",Caster.toString(clientCookies,""));
    }
View Full Code Here

     */
    public void updateDomaincookies(Boolean domainCookies) throws SecurityException {
      checkWriteAccess();
        boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManager.TYPE_SETTING);
        if(!hasAccess)
            throw new SecurityException("no access to update scope setting");
       
        Element scope=_getRootElement("scope");
        scope.setAttribute("setdomaincookies",Caster.toString(domainCookies,""));
    }
View Full Code Here

     */
    public void updateLocale(String locale) throws SecurityException {
      checkWriteAccess();
        boolean hasAccess=ConfigWebUtil.hasAccess(config,SecurityManager.TYPE_SETTING);
        if(!hasAccess)
            throw new SecurityException("no access to update regional setting");
       
        Element scope=_getRootElement("regional");
        scope.setAttribute("locale",locale.trim());
    }
View Full Code Here

  }

  @Override
  public int doEndTag() throws PageException  {
    if(pageContext.getConfig().getSecurityManager().getAccess(SecurityManager.TYPE_TAG_EXECUTE)==SecurityManager.VALUE_NO)
      throw new SecurityException("can't access tag [execute]","access is prohibited by security manager");
      try {
            _execute();
        }
      catch (PageException pe) {
           throw pe;
View Full Code Here

  }
 
  private static void checkAccessibility(Object objMaybeNull,Class clazz, Key methodName) {
    // do not allow java.lang.System.exit()
    if(methodName.equals(EXIT) && clazz==System.class) { // TODO better implementation
      throw new PageRuntimeException(new SecurityException("Calling the method java.lang.System.exit is not allowed"));       
        }
    // change the accessibility of Railo methods is not allowed
    else if(methodName.equals(SET_ACCESSIBLE)) {
      if(objMaybeNull instanceof JavaObject)
        objMaybeNull=((JavaObject)objMaybeNull).getEmbededObject(null);
      if(objMaybeNull instanceof Member) {
        Member member=(Member) objMaybeNull;
            Class<?> cls = member.getDeclaringClass();
            if(cls!=null) {
              String name=cls.getName();
              if(name!=null && name.startsWith("railo.")) {
                throw new PageRuntimeException(new SecurityException("Changing the accessibility of an object's members in the railo.* package is not allowed"));
             
            }
            
      }      
        }
View Full Code Here


  @Override
  public int doStartTag() throws PageException  {
      if(pageContext.getConfig().getSecurityManager().getAccess(SecurityManager.TYPE_TAG_REGISTRY)==SecurityManager.VALUE_NO)
      throw new SecurityException("can't access tag [registry]","access is prohibited by security manager");
   
     
      if(action==ACTION_GET) doGet();
      else if(action==ACTION_GET_ALL) doGetAll();
      else if(action==ACTION_SET) doSet();
View Full Code Here

        else if(accessType.equals("search")) return TYPE_SEARCH;
        else if(accessType.equals("cache")) return TYPE_CACHE;
        else if(accessType.equals("gateway")) return TYPE_GATEWAY;
        else if(accessType.equals("orm")) return TYPE_ORM;
        else if(accessType.startsWith("scheduled_task")) return TYPE_SCHEDULED_TASK;
        else throw new SecurityException(
                "invalid access type ["+accessType+"]",
                "valid access types are [setting,file,direct_java_access,mail,datasource,mapping,custom_tag,cfx_setting" +
                "cfx_usage,debugging]");
       
    }
View Full Code Here

        else if(accessValue.equals("6"))     return VALUE_6;
        else if(accessValue.equals("7"))     return VALUE_7;
        else if(accessValue.equals("8"))     return VALUE_8;
        else if(accessValue.equals("9"))     return VALUE_9;
        else if(accessValue.equals("10"))     return VALUE_10;
        else throw new SecurityException("invalid access value ["+accessValue+"]", "valid access values are [all,local,no,none,yes,1,...,10]");
       
    }
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.