Example usage for org.springframework.security.messaging.access.expression MessageExpressionVoter MessageExpressionVoter

List of usage examples for org.springframework.security.messaging.access.expression MessageExpressionVoter MessageExpressionVoter

Introduction

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

Prototype

MessageExpressionVoter

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.  j av a  2 s .c o m

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

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