Java 类org.springframework.security.web.access.expression.WebSecurityExpressionRoot 实例源码

项目:bootstrap    文件:ExtendedSecurityExpressionHandler.java   
@Override
protected SecurityExpressionOperations createSecurityExpressionRoot(final Authentication authentication, final FilterInvocation fi) {

    // There we use the extended version of expression manager
    final WebSecurityExpressionRoot root = new ExtendedWebSecurityExpressionRoot(authentication, fi);
    root.setPermissionEvaluator(getPermissionEvaluator());
    root.setTrustResolver(trustResolver);
    root.setRoleHierarchy(getRoleHierarchy());
    root.setDefaultRolePrefix("ROLE_");
    return root;
}
项目:oma-riista-web    文件:CustomWebSecurityExpressionHandler.java   
@Override
protected SecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, FilterInvocation fi) {
    WebSecurityExpressionRoot root = new CustomWebSecurityExpressionRoot(authentication, fi);
    root.setPermissionEvaluator(getPermissionEvaluator());
    root.setTrustResolver(new AuthenticationTrustResolverImpl());
    root.setRoleHierarchy(getRoleHierarchy());
    return root;
}
项目:subs    文件:TestWebSecurityConfig.java   
@Override
public void configure(WebSecurity web) throws Exception {
    web.expressionHandler(new DefaultWebSecurityExpressionHandler() {
        @Override
        protected SecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, FilterInvocation fi) {
            WebSecurityExpressionRoot root = (WebSecurityExpressionRoot) super.createSecurityExpressionRoot(authentication, fi);
            //root.setDefaultRolePrefix(""); //remove the prefix ROLE_
            return root;
        }
    });
}