Examples of CustomWebSecurityExpressionHandler


Examples of com.narirelays.ems.security.CustomWebSecurityExpressionHandler

      expression = new StringBuffer().append("hasAnyRole('").append(DEFAULT_ROOT_ROLE)
            .append("')").toString();//如果权限控制表达式为空,判断时按root来判断
    }
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    HttpServletRequest request = ServletActionContext.getRequest();
    CustomWebSecurityExpressionHandler filterSecurityInterceptor = (CustomWebSecurityExpressionHandler)StorageService.ctx.getBean("customExpressionHandler");
    EvaluationContext ctx = filterSecurityInterceptor.createEvaluationContext(authentication, request);
    Expression expr = new SpelExpressionParser().parseExpression(expression);
    if(ExpressionUtils.evaluateAsBoolean(expr, ctx))
    {
      result = true;
    }
View Full Code Here

Examples of com.narirelays.ems.security.CustomWebSecurityExpressionHandler

        bean.set("expression", rs.getString(2));
        bean.set("status", rs.getBoolean(3));
        return bean;
      }     
    },UI_RESOURCE_NAME);
    CustomWebSecurityExpressionHandler filterSecurityInterceptor = (CustomWebSecurityExpressionHandler)StorageService.ctx.getBean("customExpressionHandler");
    EvaluationContext ctx = filterSecurityInterceptor.createEvaluationContext(authentication, request);
    List<String>UIs = new ArrayList<String>();
    for(LazyDynaBean bean:beans)
    {
      Boolean status = (Boolean)bean.get("status");
      String path = (String)bean.get("path");
View Full Code Here

Examples of com.narirelays.ems.security.CustomWebSecurityExpressionHandler

    List<LazyDynaBean> beans = new ArrayList<LazyDynaBean>();
    if(functions==null){
      resultInfo.setFailed();
    }else{
      Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
      CustomWebSecurityExpressionHandler filterSecurityInterceptor = (CustomWebSecurityExpressionHandler)StorageService.ctx.getBean("customExpressionHandler");
      EvaluationContext ctx = filterSecurityInterceptor.createEvaluationContext(authentication, request);
      for(String function:functions){
        String expression = "hasRole('ROLE_USER') and hasIpAddress('localhost')";
        Expression expr = PARSER.parseExpression(expression);
            LazyDynaBean bean = new LazyDynaBean();
            bean.set(function, ExpressionUtils.evaluateAsBoolean(expr, ctx));
View Full Code Here

Examples of org.andidev.applicationname.config.springsecurity.CustomWebSecurityExpressionHandler

        return rememberMeAuthenticationProvider;
    }

    @Bean
    public CustomWebSecurityExpressionHandler webSecurityExpressionHandler() {
        CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler = new CustomWebSecurityExpressionHandler();
        return customWebSecurityExpressionHandler;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.