当前位置: 首页>>代码示例>>Java>>正文


Java PermissionEvaluator类代码示例

本文整理汇总了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);
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:10,代码来源:AccessControlListTag.java

示例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);
  }
}
 
开发者ID:tfeng,项目名称:play-plugins,代码行数:11,代码来源:OAuth2PermissionEvaluator.java

示例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();
}
 
开发者ID:raptorbox,项目名称:raptor,代码行数:5,代码来源:MethodSecurityConfig.java

示例7: permissionEvaluatorService

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator permissionEvaluatorService() {
    return new MyPermissionEvaluator();
}
 
开发者ID:leweihe,项目名称:lewei_angul,代码行数:5,代码来源:GlobalMethodSecurityConfig.java

示例8: CustomMethodSecurityExpressionHandler

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public CustomMethodSecurityExpressionHandler(PermissionEvaluator permissionEvaluator) {
    super();
    setPermissionEvaluator(permissionEvaluator);
}
 
开发者ID:sanketbajoria,项目名称:jittrackGTS,代码行数:5,代码来源:CustomMethodSecurityExpressionHandler.java

示例9: setPermissionEvaluator

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public void setPermissionEvaluator(PermissionEvaluator permissionEvaluator) {
    this.permissionEvaluator = permissionEvaluator;
}
 
开发者ID:amertum,项目名称:spring-security-play2,代码行数:4,代码来源:SecurityExpressionOperationsSupplier.java

示例10: getPermissionEvaluator

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public PermissionEvaluator getPermissionEvaluator() {
  return permissionEvaluator;
}
 
开发者ID:tfeng,项目名称:play-plugins,代码行数:4,代码来源:OAuth2Plugin.java

示例11: permissionEvaluator

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator permissionEvaluator(AclService aclService) {
    return new AclPermissionEvaluator(aclService);
}
 
开发者ID:rafizanbaharum,项目名称:cfi-gov,代码行数:5,代码来源:CfWebAccessConfig.java

示例12: permissionEvaluator

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
@Bean
public PermissionEvaluator permissionEvaluator() {
	return new ApplicationPermissionEvaluator();
}
 
开发者ID:thm-projects,项目名称:arsnova-backend,代码行数:5,代码来源:SecurityConfig.java

示例13: setPermissionEvaluator

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
public void setPermissionEvaluator(PermissionEvaluator permissionEvaluator) {
	this.permissionEvaluator = permissionEvaluator;
}
 
开发者ID:dana-i2cat,项目名称:opennaas-routing-nfv,代码行数:4,代码来源:ACLManager.java

示例14: getPermissionEvaluator

import org.springframework.security.access.PermissionEvaluator; //导入依赖的package包/类
/**
 * SpringSecurity Bean配置
 *
 * @return
 */
@Bean
public PermissionEvaluator getPermissionEvaluator() {
    return new PermissionEvaluatorImpl();
}
 
开发者ID:Wangzr,项目名称:micro-service-framework,代码行数:10,代码来源:WebConfiguration.java


注:本文中的org.springframework.security.access.PermissionEvaluator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。