All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.anteros.security.spring.AnterosSecurityAccessDecisionManagerFactoryBean Maven / Gradle / Ivy

There is a newer version: 2.0.20
Show newest version
package br.com.anteros.security.spring;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.access.AccessDecisionVoter;

public class AnterosSecurityAccessDecisionManagerFactoryBean  implements FactoryBean, InitializingBean {
	private AnterosSecurityAccessDecisionManager accessDecisionManager;

	public AnterosSecurityAccessDecisionManagerFactoryBean() {
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		buildAccessDecisionManager();		
	}

	private void buildAccessDecisionManager() {
		List> decisionVoters = new ArrayList>();
		decisionVoters.add(new AnterosSecurityVoter());
		accessDecisionManager = new AnterosSecurityAccessDecisionManager(decisionVoters);
		
	}

	@Override
	public AnterosSecurityAccessDecisionManager getObject() throws Exception {
		return accessDecisionManager;
	}

	@Override
	public Class getObjectType() {
		return AnterosSecurityAccessDecisionManager.class;
	}

	@Override
	public boolean isSingleton() {
		return false;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy