Package org.springframework.security.access

Examples of org.springframework.security.access.SecurityConfig


        String[] attributeTokens = ((Secured) a).value();
        List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>(attributeTokens.length);

        for(String token : attributeTokens) {
            attributes.add(new SecurityConfig(token));
        }

        return attributes;
    }
View Full Code Here


  AuthoryDao authoryDao;

  @Override
  public Collection<ConfigAttribute> getAllConfigAttributes() {
    List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>();
    attributes.add(new SecurityConfig("authoriy"));
    return null;
  }
View Full Code Here

            String[] attributeTokens = StringUtils.commaDelimitedListToStringArray(accessConfig);
            List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>(attributeTokens.length);

            for(String token : attributeTokens) {
                attributes.add(new SecurityConfig(token));
            }

            pointcutMap.put(expression, attributes);
        }
View Full Code Here

            String[] attributeTokens = StringUtils.commaDelimitedListToStringArray(accessConfig);
            List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>(attributeTokens.length);

            for(String token : attributeTokens) {
                attributes.add(new SecurityConfig(token));
            }

            pointcutMap.put(expression, attributes);
        }
View Full Code Here

      LinkedHashMap<RequestKey, Collection<ConfigAttribute>> distMap = new LinkedHashMap<RequestKey, Collection<ConfigAttribute>>();
     
      for (Map.Entry<String, String> entry : srcMap.entrySet()) {
        RequestKey key = new RequestKey(entry.getKey(), null);
        //使用SecurityConfig构造List<ConfigAttribute>
        SecurityConfig sc = new SecurityConfig(entry.getValue());
        List<ConfigAttribute> list = sc.createList(sc.getAttribute());
        distMap.put(key, list);
      }

      return distMap;
    }
View Full Code Here

            ConfigAttribute ca = null;
            if(entry.getValue()==null) {
              continue;
            }
            for(String configAttribute : entry.getValue().split(",")) {
              ca = new SecurityConfig(configAttribute);
              atts.add(ca);
            }
            resourceMap.put(entry.getKey(), atts);
      }
           
View Full Code Here

       Map<String, Set<String>> resourceMap = this.findResources();
       for(String url : resourceMap.keySet()){
           Set<String> roleSet = resourceMap.get(url);
           Collection<ConfigAttribute> catts  = new HashSet<ConfigAttribute>();
           for(String role : roleSet){
                   catts.add(new SecurityConfig(role));
           }
           allCfgattrs.addAll(catts);
           requestMap.put(url, catts);
       }
      
View Full Code Here

   public void addConfigAttribute(Role role) throws Exception{
    
     if(ValidationUtil.validateList(role.getOpcionesMenu())){
      
       Collection<ConfigAttribute> catts  = new HashSet<ConfigAttribute>();
       catts.add(new SecurityConfig(role.getName()));
       allCfgattrs.addAll(catts);    
    
         Iterator<String> ite = resourceMap.keySet().iterator();        
         while (ite.hasNext()) {          
             String deMenu = ite.next();
             Collection<ConfigAttribute> configAtt = resourceMap.get(deMenu);
             if (configAtt.contains(new SecurityConfig(role.getName()))) {
               configAtt.remove(new SecurityConfig(role.getName()));
               resourceMap.put(deMenu, configAtt);
             }
         }
      
       for(Iterator<OpcionMenu> iter = role.getOpcionesMenu().iterator(); iter.hasNext(); ){
          
         OpcionMenu opcionMenu = iter.next();
         String deMenuHtml = opcionMenu.getDeMenuHtml();
        
           if(deMenuHtml != null && (opcionMenu.isStElegido() ||
              Constants.URL_LOGOUT.equalsIgnoreCase(deMenuHtml) ||
              Constants.URL_MAIN_MENU.equalsIgnoreCase(deMenuHtml))){
            
             if(!deMenuHtml.startsWith("/"))
               deMenuHtml = "/"+deMenuHtml;
            
             Collection<ConfigAttribute> roleConfig = resourceMap.get(deMenuHtml);
             if(roleConfig == null){
               resourceMap.put(deMenuHtml, catts);
             }else{            
               roleConfig.add(new SecurityConfig(role.getName()));
               resourceMap.put(deMenuHtml, roleConfig);
             }                   
           }    
         }
      }
View Full Code Here

  }

  @Test
  public void testAuthenticationSuccess() {
    this.listener.onApplicationEvent(new AuthorizationFailureEvent(this, Arrays
        .<ConfigAttribute> asList(new SecurityConfig("USER")),
        new UsernamePasswordAuthenticationToken("user", "password"),
        new AccessDeniedException("Bad user")));
    verify(this.publisher).publishEvent((ApplicationEvent) anyObject());
  }
View Full Code Here

    }


    private ChannelSecurityConfigurer<H> addAttribute(String attribute, List<RequestMatcher> matchers) {
        for(RequestMatcher matcher : matchers) {
            Collection<ConfigAttribute> attrs = Arrays.<ConfigAttribute>asList(new SecurityConfig(attribute));
            requestMap.put(matcher, attrs);
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.access.SecurityConfig

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.