Example usage for org.springframework.security.messaging.access.intercept ChannelSecurityInterceptor setAccessDecisionManager

List of usage examples for org.springframework.security.messaging.access.intercept ChannelSecurityInterceptor setAccessDecisionManager

Introduction

In this page you can find the example usage for org.springframework.security.messaging.access.intercept ChannelSecurityInterceptor setAccessDecisionManager.

Prototype

public void setAccessDecisionManager(AccessDecisionManager accessDecisionManager) 

Source Link

Usage

From source file:ch.rasc.wampspring.security.AbstractSecurityWampConfigurer.java

@Bean
public ChannelSecurityInterceptor inboundChannelSecurity() {
    ChannelSecurityInterceptor channelSecurityInterceptor = new ChannelSecurityInterceptor(
            inboundMessageSecurityMetadataSource());
    List<AccessDecisionVoter<? extends Object>> voters = new ArrayList<>();
    voters.add(new MessageExpressionVoter<>());
    AffirmativeBased manager = new AffirmativeBased(voters);
    channelSecurityInterceptor.setAccessDecisionManager(manager);
    return channelSecurityInterceptor;
}

From source file:com.northstrat.springsecurity.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer.java

@Bean
public ChannelSecurityInterceptor inboundChannelSecurity() {
    ChannelSecurityInterceptor channelSecurityInterceptor = new ChannelSecurityInterceptor(
            inboundMessageSecurityMetadataSource());
    MessageExpressionVoter<Object> voter = new MessageExpressionVoter<Object>();
    if (expressionHandler != null) {
        voter.setExpressionHandler(expressionHandler);
    }// w  w  w  .  jav  a 2  s . co m

    List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
    voters.add(voter);

    AffirmativeBased manager = new AffirmativeBased(voters);
    channelSecurityInterceptor.setAccessDecisionManager(manager);
    return channelSecurityInterceptor;
}