com.payneteasy.superfly.security.DelegatingDecisionManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of superfly-spring-security Show documentation
Show all versions of superfly-spring-security Show documentation
Module for Spring Security which enables application to use Superfly authentication/authorization declaratively through Spring Security
package com.payneteasy.superfly.security;
import com.payneteasy.superfly.security.exception.InsufficientAuthenticationException;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.core.Authentication;
import java.util.Collection;
public class DelegatingDecisionManager implements AccessDecisionManager {
private AccessDecisionManager delegate;
public DelegatingDecisionManager() {
}
public DelegatingDecisionManager(AccessDecisionManager delegate) {
this.delegate = delegate;
}
public void setDelegate(AccessDecisionManager delegate) {
this.delegate = delegate;
}
protected AccessDecisionManager getDelegate() {
return delegate;
}
public void decide(Authentication authentication, Object object,
Collection configAttributes)
throws AccessDeniedException, InsufficientAuthenticationException {
delegate.decide(authentication, object, configAttributes);
}
public boolean supports(ConfigAttribute attribute) {
return delegate.supports(attribute);
}
public boolean supports(Class> clazz) {
return delegate.supports(clazz);
}
}