本文整理汇总了Java中org.springframework.security.web.access.expression.WebExpressionVoter类的典型用法代码示例。如果您正苦于以下问题:Java WebExpressionVoter类的具体用法?Java WebExpressionVoter怎么用?Java WebExpressionVoter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WebExpressionVoter类属于org.springframework.security.web.access.expression包,在下文中一共展示了WebExpressionVoter类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureUrlAuthorization
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Override
protected void configureUrlAuthorization(
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry expressionInterceptUrlRegistry)
{
@SuppressWarnings("rawtypes")
List<AccessDecisionVoter> listOfVoters = new ArrayList<AccessDecisionVoter>();
listOfVoters.add(new WebExpressionVoter());
listOfVoters.add(new MolgenisAccessDecisionVoter());
expressionInterceptUrlRegistry.accessDecisionManager(new AffirmativeBased(listOfVoters));
expressionInterceptUrlRegistry.antMatchers("/").permitAll()
// DAS datasource uses the database, unauthenticated users can
// not see any data
.antMatchers("/das/**").permitAll()
.antMatchers("/myDas/**").permitAll()
.antMatchers("/annotators/**").authenticated()
.antMatchers("/charts/**").authenticated();
}
示例2: accessDecisionManager
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Description("ConsensusBased AccessDecisionManager for Authorization voting")
@Bean
public AccessDecisionManager accessDecisionManager(
CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
List<AccessDecisionVoter<? extends Object>> decisionVoters
= Arrays.asList(
// new AuthenticatedVoter(),
// new RoleVoter(),
new WebExpressionVoter(){{
setExpressionHandler(customWebSecurityExpressionHandler);
}}
);
return new ConsensusBased(decisionVoters);
}
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:15,代码来源:CustomAuthorizationConfig.java
示例3: accessDecisionManager2
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
public AccessDecisionManager accessDecisionManager2(
CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
List<AccessDecisionVoter<? extends Object>> decisionVoters
= Arrays.asList(
new AuthenticatedVoter(),
new RoleVoter(),
new WebExpressionVoter(){{
setExpressionHandler(customWebSecurityExpressionHandler);
}}
);
return new UnanimousBased(decisionVoters);
}
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:CustomAuthorizationConfig.java
示例4: accessDecisionManager
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Description("AccessDecisionManager for Authorization voting")
@Bean
public AccessDecisionManager accessDecisionManager(
CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
List<AccessDecisionVoter<? extends Object>> decisionVoters
= Arrays.asList(
new WebExpressionVoter(){{
setExpressionHandler(customWebSecurityExpressionHandler);
}}
);
return new ConsensusBased(decisionVoters);
}
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:CustomAuthorizationConfig.java
示例5: accessDecisionManager
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Description("ConsensusBased AccessDecisionManager for Authorization voting")
@Bean
public AccessDecisionManager accessDecisionManager(
CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
List<AccessDecisionVoter<? extends Object>> decisionVoters
= Arrays.asList(
new WebExpressionVoter(){{
setExpressionHandler(customWebSecurityExpressionHandler);
}}
);
return new ConsensusBased(decisionVoters);
}
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:13,代码来源:CustomAuthorizationConfig.java
示例6: checkUrlAccessExpression
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
private void checkUrlAccessExpression() {
log.debug("check if URL access expressions are allowed");
String[] names = context.getBeanDefinitionNames();
for (String name : names) {
if (context.getBean(name) instanceof AbstractAccessDecisionManager) {
for (AccessDecisionVoter v : ((AbstractAccessDecisionManager) context.getBean(name)).getDecisionVoters()) {
if (v instanceof WebExpressionVoter) {
log.debug("parse urlAccess as EL expression");
urlAccessExpression = true;
return;
}
}
}
}
log.debug("parse urlAccess as simple expression");
urlAccessExpression = false;
}
示例7: filterInvocationInterceptor
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Bean
public FilterSecurityInterceptor filterInvocationInterceptor(){
List<AccessDecisionVoter> vote = new ArrayList<AccessDecisionVoter>(Arrays.asList(new WebExpressionVoter()));
AffirmativeBased voters = new AffirmativeBased(vote);
voters.setAllowIfAllAbstainDecisions(false);
FilterSecurityInterceptor bean = new FilterSecurityInterceptor();
bean.setAuthenticationManager(authenticationManager());
bean.setAccessDecisionManager(voters);
bean.setSecurityMetadataSource(securityMetadataSource);
bean.setMessageSource(messageSource);
return bean;
}
示例8: configureUrlAuthorization
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Override
protected void configureUrlAuthorization(
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry expressionInterceptUrlRegistry)
{
List<AccessDecisionVoter<?>> listOfVoters = new ArrayList<>();
listOfVoters.add(new WebExpressionVoter());
listOfVoters.add(new MolgenisAccessDecisionVoter());
expressionInterceptUrlRegistry.accessDecisionManager(new AffirmativeBased(listOfVoters));
expressionInterceptUrlRegistry.antMatchers("/").permitAll().antMatchers("/fdp/**").permitAll()
.antMatchers("/annotators/**").authenticated()
.antMatchers("/charts/**").authenticated();
}
示例9: create
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public static HandlerSecurityInterceptor create() {
HandlerSecurityInterceptor interceptor = new HandlerSecurityInterceptor();
WebExpressionVoterAdapter voter = new WebExpressionVoterAdapter(new WebExpressionVoter());
AccessDecisionManager accessDecisionManager = new AffirmativeBased(Arrays.<AccessDecisionVoter> asList(voter));
interceptor.setAccessDecisionManager(accessDecisionManager);
interceptor.setSecurityMetadataSource(new ExpressionBasedHandlerInvocationSecurityMetadataSource());
return interceptor;
}
开发者ID:mateuszwenus,项目名称:spring-security-controller-auth,代码行数:10,代码来源:HandlerSecurityInterceptor.java
示例10: configureUrlAuthorization
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Override
protected void configureUrlAuthorization(
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry expressionInterceptUrlRegistry)
{
List<AccessDecisionVoter<?>> listOfVoters = new ArrayList<>();
listOfVoters.add(new WebExpressionVoter());
listOfVoters.add(new MolgenisAccessDecisionVoter());
expressionInterceptUrlRegistry.accessDecisionManager(new AffirmativeBased(listOfVoters));
expressionInterceptUrlRegistry.antMatchers("/").permitAll()
.antMatchers("/fdp/**").permitAll()
.antMatchers("/annotators/**").authenticated();
}
示例11: webExpressionVoter
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Bean
public WebExpressionVoter webExpressionVoter() {
WebExpressionVoter result = new WebExpressionVoter();
result.setExpressionHandler(rbacWebSecurityExpressionHandler());
return result;
}
示例12: accessDecisionManager
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Bean
public AccessDecisionManager accessDecisionManager(){
AffirmativeBased affirmative = new AffirmativeBased(Arrays.asList(multiWebExpressionVoter(), new WebExpressionVoter(), new AuthenticatedVoter()));
return affirmative;
}
示例13: webExpressionVoter
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
@Bean
public WebExpressionVoter webExpressionVoter() {
return new WebExpressionVoter();
}
示例14: WebExpressionVoterAdapter
import org.springframework.security.web.access.expression.WebExpressionVoter; //导入依赖的package包/类
public WebExpressionVoterAdapter(WebExpressionVoter webExpressionVoter) {
this.webExpressionVoter = webExpressionVoter;
}