br.com.anteros.security.spring.config.AnterosSpringGlobalMethodSecurityConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-Security-Spring Show documentation
Show all versions of Anteros-Security-Spring Show documentation
Anteros Security Spring for Java.
package br.com.anteros.security.spring.config;
import java.util.ArrayList;
import java.util.List;
import org.springframework.context.annotation.Bean;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration;
import br.com.anteros.security.spring.AnterosSecurityAccessDecisionManager;
import br.com.anteros.security.spring.AnterosSecurityVoter;
public class AnterosSpringGlobalMethodSecurityConfiguration extends GlobalMethodSecurityConfiguration {
@Bean
public AnterosSecurityAccessDecisionManager anterosSecurityMethodAccessDecisionManager() {
List> decisionVoters = new ArrayList>();
decisionVoters.add(new AnterosSecurityVoter());
AnterosSecurityAccessDecisionManager result = new AnterosSecurityAccessDecisionManager(decisionVoters);
return result;
}
@Override
protected AccessDecisionManager accessDecisionManager() {
return anterosSecurityMethodAccessDecisionManager();
}
}