Example usage for org.springframework.security.web.access.intercept RequestKey RequestKey

List of usage examples for org.springframework.security.web.access.intercept RequestKey RequestKey

Introduction

In this page you can find the example usage for org.springframework.security.web.access.intercept RequestKey RequestKey.

Prototype

public RequestKey(String url) 

Source Link

Usage

From source file:ch.astina.hesperid.web.services.springsecurity.RequestInvocationDefinition.java

public RequestInvocationDefinition(String key, String roles) {
    this.requestKey = new RequestKey(key);
    String[] allAttrs = StringUtils.stripAll(StringUtils.splitPreserveAllTokens(roles, ','));
    this.configAttributes = new ArrayList<ConfigAttribute>();
    for (String attr : allAttrs) {
        this.configAttributes.add(new SecurityConfig(attr));
    }//from w  w w .j a  va2  s. com

}

From source file:ch.ksfx.web.services.springsecurity.RequestInvocationDefinition.java

public RequestInvocationDefinition(String key, String roles) {
    this.requestKey = new RequestKey(key);
    String[] allAttrs = StringUtils.stripAll(StringUtils.splitPreserveAllTokens(roles, ','));

    this.configAttributes = new ArrayList<ConfigAttribute>();

    for (String attr : allAttrs) {
        this.configAttributes.add(new SecurityConfig(attr));
    }/* ww w.  j a  v  a  2  s .  c o  m*/
}

From source file:org.codehaus.groovy.grails.plugins.springsecurity.ChannelFilterInvocationSecurityMetadataSourceFactoryBean.java

protected LinkedHashMap<RequestKey, Collection<ConfigAttribute>> buildMap() {
    LinkedHashMap<RequestKey, Collection<ConfigAttribute>> map = new LinkedHashMap<RequestKey, Collection<ConfigAttribute>>();
    for (Map.Entry<String, String> entry : _definition.entrySet()) {
        String value = entry.getValue();
        if (value == null) {
            throw new IllegalArgumentException("The rule for URL '" + value + "' cannot be null");
        }//  w w w .j a v a2 s .  c om
        value = value.trim();

        if (!"ANY_CHANNEL".equals(value) && !"REQUIRES_SECURE_CHANNEL".equals(value)
                && !"REQUIRES_INSECURE_CHANNEL".equals(value)) {
            throw new IllegalArgumentException("The rule for URL '" + value
                    + "' must be one of REQUIRES_SECURE_CHANNEL, REQUIRES_INSECURE_CHANNEL, or ANY_CHANNEL");
        }

        map.put(new RequestKey(entry.getKey()), SecurityConfig.createSingleAttributeList(value));
    }
    return map;
}