本文整理汇总了Java中org.springframework.security.access.PermissionEvaluator类的典型用法代码示例。如果您正苦于以下问题:Java PermissionEvaluator类的具体用法?Java PermissionEvaluator怎么用?Java PermissionEvaluator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PermissionEvaluator类属于org.springframework.security.access包,在下文中一共展示了PermissionEvaluator类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: methodSecurityExpressionHandlerIsConfiguredWithPermissionEvaluatorFromTheContext
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Test
public void methodSecurityExpressionHandlerIsConfiguredWithPermissionEvaluatorFromTheContext() {
this.context = new AnnotationConfigServletWebServerApplicationContext();
this.context.register(PermissionEvaluatorConfiguration.class,
AuthorizationAndResourceServerConfiguration.class,
MinimalSecureWebApplication.class);
this.context.refresh();
PreInvocationAuthorizationAdvice advice = this.context
.getBean(PreInvocationAuthorizationAdvice.class);
MethodSecurityExpressionHandler expressionHandler = (MethodSecurityExpressionHandler) ReflectionTestUtils
.getField(advice, "expressionHandler");
PermissionEvaluator permissionEvaluator = (PermissionEvaluator) ReflectionTestUtils
.getField(expressionHandler, "permissionEvaluator");
assertThat(permissionEvaluator)
.isSameAs(this.context.getBean(PermissionEvaluator.class));
}
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:17,代码来源:OAuth2AutoConfigurationTests.java
示例2: getExpressionHandler
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
private OAuth2MethodSecurityExpressionHandler getExpressionHandler(
DefaultMethodSecurityExpressionHandler bean) {
OAuth2MethodSecurityExpressionHandler handler = new OAuth2MethodSecurityExpressionHandler();
handler.setApplicationContext(this.applicationContext);
AuthenticationTrustResolver trustResolver = findInContext(
AuthenticationTrustResolver.class);
if (trustResolver != null) {
handler.setTrustResolver(trustResolver);
}
PermissionEvaluator permissions = findInContext(PermissionEvaluator.class);
if (permissions != null) {
handler.setPermissionEvaluator(permissions);
}
handler.setExpressionParser(bean.getExpressionParser());
return handler;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:OAuth2MethodSecurityConfiguration.java
示例3: initializeIfRequired
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
private void initializeIfRequired() throws JspException {
if (applicationContext != null) {
return;
}
this.applicationContext = getContext(pageContext);
permissionEvaluator = getBeanOfType(PermissionEvaluator.class);
}
示例4: hasPermission
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Override
public boolean hasPermission(Authentication authentication, Object targetDomainObject,
Object permission) {
PermissionEvaluator permissionEvaluator = OAuth2Plugin.getInstance().getPermissionEvaluator();
if (permissionEvaluator == null) {
throw new RuntimeException("Permission evaluator is not configured");
} else {
return permissionEvaluator.hasPermission(authentication, targetDomainObject, permission);
}
}
示例5: permissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator permissionEvaluator() {
return mock(PermissionEvaluator.class);
}
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:5,代码来源:OAuth2AutoConfigurationTests.java
示例6: aclPermissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator aclPermissionEvaluator() {
return new AclPermissionEvaluator();
}
示例7: permissionEvaluatorService
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator permissionEvaluatorService() {
return new MyPermissionEvaluator();
}
示例8: CustomMethodSecurityExpressionHandler
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public CustomMethodSecurityExpressionHandler(PermissionEvaluator permissionEvaluator) {
super();
setPermissionEvaluator(permissionEvaluator);
}
示例9: setPermissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public void setPermissionEvaluator(PermissionEvaluator permissionEvaluator) {
this.permissionEvaluator = permissionEvaluator;
}
示例10: getPermissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public PermissionEvaluator getPermissionEvaluator() {
return permissionEvaluator;
}
示例11: permissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator permissionEvaluator(AclService aclService) {
return new AclPermissionEvaluator(aclService);
}
示例12: permissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator permissionEvaluator() {
return new ApplicationPermissionEvaluator();
}
示例13: setPermissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public void setPermissionEvaluator(PermissionEvaluator permissionEvaluator) {
this.permissionEvaluator = permissionEvaluator;
}
示例14: getPermissionEvaluator
import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
/**
* SpringSecurity Bean配置
*
* @return
*/
@Bean
public PermissionEvaluator getPermissionEvaluator() {
return new PermissionEvaluatorImpl();
}