Example usage for org.springframework.security.web.servletapi SecurityContextHolderAwareRequestFilter setRolePrefix

List of usage examples for org.springframework.security.web.servletapi SecurityContextHolderAwareRequestFilter setRolePrefix

Introduction

In this page you can find the example usage for org.springframework.security.web.servletapi SecurityContextHolderAwareRequestFilter setRolePrefix.

Prototype

public void setRolePrefix(String rolePrefix) 

Source Link

Usage

From source file:org.apache.syncope.core.misc.spring.DefaultRolesPrefixPostProcessor.java

@Override
public Object postProcessAfterInitialization(final Object bean, final String beanName) {
    if (bean instanceof DefaultMethodSecurityExpressionHandler) {
        ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }/* w w  w  . j  a  v a2  s  .  c  om*/
    if (bean instanceof DefaultWebSecurityExpressionHandler) {
        ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if (bean instanceof SecurityContextHolderAwareRequestFilter) {
        SecurityContextHolderAwareRequestFilter filter = (SecurityContextHolderAwareRequestFilter) bean;
        filter.setRolePrefix(StringUtils.EMPTY);
        try {
            filter.afterPropertiesSet();
        } catch (ServletException e) {
            throw new FatalBeanException(e.getMessage(), e);
        }
    }

    return bean;
}