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

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

Introduction

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

Prototype

public ChannelSecurityInterceptor(MessageSecurityMetadataSource metadataSource) 

Source Link

Document

Creates a new instance

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);
    }/*from   w w  w.  j a  va 2s  .  com*/

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

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