本文整理汇总了Java中org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler类的典型用法代码示例。如果您正苦于以下问题:Java DefaultWebSecurityExpressionHandler类的具体用法?Java DefaultWebSecurityExpressionHandler怎么用?Java DefaultWebSecurityExpressionHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultWebSecurityExpressionHandler类属于org.springframework.security.web.access.expression包,在下文中一共展示了DefaultWebSecurityExpressionHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postProcessAfterInitialization
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Override
public Object postProcessAfterInitialization(Object bean, String beanName)
throws BeansException {
// remove this if you are not using JSR-250
if(bean instanceof Jsr250MethodSecurityMetadataSource) {
((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix(null);
}
if(bean instanceof DefaultMethodSecurityExpressionHandler) {
((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
}
if(bean instanceof DefaultWebSecurityExpressionHandler) {
((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
}
if(bean instanceof SecurityContextHolderAwareRequestFilter) {
((SecurityContextHolderAwareRequestFilter)bean).setRolePrefix("");
}
if(bean instanceof RoleVoter){
((RoleVoter) bean).setRolePrefix("");
}
return bean;
}
示例2: postProcessAfterInitialization
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
// remove this if you are not using JSR-250
if (bean instanceof Jsr250MethodSecurityMetadataSource) {
((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix(this.rolePrefix);
}
if (bean instanceof DefaultMethodSecurityExpressionHandler) {
((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(this.rolePrefix);
}
if (bean instanceof DefaultWebSecurityExpressionHandler) {
((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(this.rolePrefix);
}
if (bean instanceof SecurityContextHolderAwareRequestFilter) {
((SecurityContextHolderAwareRequestFilter) bean).setRolePrefix(this.rolePrefix);
}
return bean;
}
示例3: postProcessAfterInitialization
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Override
public Object postProcessAfterInitialization( Object bean, String beanName )
throws BeansException
{
if ( bean instanceof Jsr250MethodSecurityMetadataSource )
{
((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix( null );
}
if ( bean instanceof DefaultMethodSecurityExpressionHandler )
{
((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix( null );
}
if ( bean instanceof DefaultWebSecurityExpressionHandler )
{
((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix( null );
}
if ( bean instanceof SecurityContextHolderAwareRequestFilter )
{
((SecurityContextHolderAwareRequestFilter) bean).setRolePrefix( "" );
}
return bean;
}
示例4: postProcessAfterInitialization
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Override
public Object postProcessAfterInitialization(final Object bean, final String beanName) {
if (bean instanceof DefaultMethodSecurityExpressionHandler) {
((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
}
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;
}
示例5: postProcessAfterInitialization
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
// remove this if you are not using JSR-250
if (bean instanceof Jsr250MethodSecurityMetadataSource) {
((Jsr250MethodSecurityMetadataSource) bean).setDefaultRolePrefix(null);
}
if (bean instanceof DefaultMethodSecurityExpressionHandler) {
((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
}
if (bean instanceof DefaultWebSecurityExpressionHandler) {
((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
}
if (bean instanceof SecurityContextHolderAwareRequestFilter) {
((SecurityContextHolderAwareRequestFilter) bean).setRolePrefix("");
}
return bean;
}
示例6: webExpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
/**
* JSP / Thymeleaf Permissions
*/
@Bean
public DefaultWebSecurityExpressionHandler webExpressionHandler(){
return new DefaultWebSecurityExpressionHandler(){{
setPermissionEvaluator(permissionEvaluator());
}};
}
示例7: expressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
/**
* Gets the {@link SecurityExpressionHandler} which is used for role hierarchy definition
*
* @return authenticationTokenFilter
*/
private SecurityExpressionHandler<FilterInvocation> expressionHandler() {
DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy());
return defaultWebSecurityExpressionHandler;
}
示例8: configure
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@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;
}
});
}
示例9: webExpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
defaultWebSecurityExpressionHandler.setDefaultRolePrefix("");
return defaultWebSecurityExpressionHandler;
}
示例10: webSecurityExpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Bean
public SecurityExpressionHandler<FilterInvocation> webSecurityExpressionHandler(RoleHierarchy roleHierarchy) {
final DefaultWebSecurityExpressionHandler handler = new CustomWebSecurityExpressionHandler();
handler.setRoleHierarchy(roleHierarchy);
return handler;
}
示例11: getWebExpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Bean
public DefaultWebSecurityExpressionHandler getWebExpressionHandler() {
DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
handler.setPermissionEvaluator(getPermissionEvaluator());
return handler;
}
示例12: webExpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy);
return defaultWebSecurityExpressionHandler;
}
示例13: webExpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy());
return defaultWebSecurityExpressionHandler;
}
示例14: webexpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
@Bean
public DefaultWebSecurityExpressionHandler webexpressionHandler(){
return new DefaultWebSecurityExpressionHandler();
}
示例15: webExpressionHandler
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler; //导入依赖的package包/类
private SecurityExpressionHandler<FilterInvocation> webExpressionHandler() {
DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
handler.setRoleHierarchy(roleHierarchy());
return handler;
}