當前位置: 首頁>>代碼示例>>Java>>正文


Java MethodSecurityExpressionHandler類代碼示例

本文整理匯總了Java中org.springframework.security.access.expression.method.MethodSecurityExpressionHandler的典型用法代碼示例。如果您正苦於以下問題:Java MethodSecurityExpressionHandler類的具體用法?Java MethodSecurityExpressionHandler怎麽用?Java MethodSecurityExpressionHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MethodSecurityExpressionHandler類屬於org.springframework.security.access.expression.method包,在下文中一共展示了MethodSecurityExpressionHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: methodSecurityExpressionHandlerIsConfiguredWithPermissionEvaluatorFromTheContext

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的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: methodSecurityExpressionHandlerIsConfiguredWithRoleHierarchyFromTheContext

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Test
public void methodSecurityExpressionHandlerIsConfiguredWithRoleHierarchyFromTheContext() {
	this.context = new AnnotationConfigServletWebServerApplicationContext();
	this.context.register(RoleHierarchyConfiguration.class,
			AuthorizationAndResourceServerConfiguration.class,
			MinimalSecureWebApplication.class);
	this.context.refresh();
	PreInvocationAuthorizationAdvice advice = this.context
			.getBean(PreInvocationAuthorizationAdvice.class);
	MethodSecurityExpressionHandler expressionHandler = (MethodSecurityExpressionHandler) ReflectionTestUtils
			.getField(advice, "expressionHandler");
	RoleHierarchy roleHierarchy = (RoleHierarchy) ReflectionTestUtils
			.getField(expressionHandler, "roleHierarchy");
	assertThat(roleHierarchy).isSameAs(this.context.getBean(RoleHierarchy.class));
}
 
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:16,代碼來源:OAuth2AutoConfigurationTests.java

示例3: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
    DefaultMethodSecurityExpressionHandler expressionHandler =
            new DefaultMethodSecurityExpressionHandler();
    expressionHandler.setPermissionEvaluator(platformPermissionEvaluator);
    return expressionHandler;
}
 
開發者ID:abixen,項目名稱:abixen-platform,代碼行數:8,代碼來源:PlatformGlobalMethodSecurityConfiguration.java

示例4: expressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
public MethodSecurityExpressionHandler expressionHandler(ICorePermissionEvaluator corePermissionEvaluator) {
	CoreMethodSecurityExpressionHandler methodSecurityExpressionHandler = new CoreMethodSecurityExpressionHandler();
	methodSecurityExpressionHandler.setCorePermissionEvaluator(corePermissionEvaluator);
	
	// Discover parameter name using the @PermissionObject annotation, too
	methodSecurityExpressionHandler.setParameterNameDiscoverer(new DefaultSecurityParameterNameDiscoverer(
			ImmutableList.of(
					new AnnotationParameterNameDiscoverer(PermissionObject.class.getName())
			)
	));
	
	return methodSecurityExpressionHandler;
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:15,代碼來源:AbstractJpaSecuritySecuredConfig.java

示例5: globalMethodSecurityConfiguration

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Bean
public GlobalMethodSecurityConfiguration globalMethodSecurityConfiguration() {
    return new GlobalMethodSecurityConfiguration() {
        @Override
        protected MethodSecurityExpressionHandler createExpressionHandler() {
            return new OAuth2MethodSecurityExpressionHandler();
        }
    };
}
 
開發者ID:pivotal-cf,項目名稱:identity-sample-apps,代碼行數:10,代碼來源:Application.java

示例6: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
	DefaultMethodSecurityExpressionHandler expressionHandler = new DefaultMethodSecurityExpressionHandler();
	// expressionHandler.setPermissionEvaluator(permissionEvaluator());
	expressionHandler.setRoleHierarchy(roleHierarchy());
	return expressionHandler;
}
 
開發者ID:jgribonvald,項目名稱:demo-spring-security-cas,代碼行數:8,代碼來源:MethodSecurityConfig.java

示例7: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
/**
 * This is needed so {@link org.springframework.security.access.prepost.PreAuthorize} and so on know the role hierarchy.
 */
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
    DefaultMethodSecurityExpressionHandler methodSecurityExpressionHandler = new DefaultMethodSecurityExpressionHandler();
    methodSecurityExpressionHandler.setRoleHierarchy(roleHierarchy);

    //Needs to be done so we can access beans in security expressions
    methodSecurityExpressionHandler.setApplicationContext(applicationContext);
    return methodSecurityExpressionHandler;
}
 
開發者ID:techdev-solutions,項目名稱:spring-test-example,代碼行數:13,代碼來源:MethodSecurityConfiguration.java

示例8: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
    final DefaultMethodSecurityExpressionHandler expressionHandler =
            new DefaultMethodSecurityExpressionHandler();
    expressionHandler.setPermissionEvaluator(permissionEvaluator);
    expressionHandler.setApplicationContext(applicationContext);
    return expressionHandler;
}
 
開發者ID:kTT,項目名稱:adjule,代碼行數:9,代碼來源:MethodSecurityConfig.java

示例9: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
	return new OAuth2MethodSecurityExpressionHandler();
}
 
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:5,代碼來源:OAuth2AutoConfigurationTests.java

示例10: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
    return new OAuth2MethodSecurityExpressionHandler();
}
 
開發者ID:MinsxCloud,項目名稱:minsx-framework,代碼行數:5,代碼來源:MethodSecurityConfig.java

示例11: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
/**
 * Customize the MethodSecurityExpressionHandler so we can use the SPEL
 * variable 'oauth2' with security annotations like @PreAuthorize
 */
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
	return new OAuth2MethodSecurityExpressionHandler();
}
 
開發者ID:dserradji,項目名稱:reactive-customer-service,代碼行數:9,代碼來源:OAuth2GlobalMethodSecurityConfiguration.java

示例12: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
  return new OAuth2MethodSecurityExpressionHandler();
}
 
開發者ID:venus-boot,項目名稱:saluki,代碼行數:5,代碼來源:WebSecurityConfiguration.java

示例13: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
    return new Zg2proSecurityExpressionHandler();
}
 
開發者ID:zg2pro,項目名稱:spring-rest-basis-example,代碼行數:5,代碼來源:Zg2proMethodSecurityConfig.java

示例14: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
    DefaultMethodSecurityExpressionHandler expressionHandler = new CustomMethodSecurityExpressionHandler();
    expressionHandler.setRoleHierarchy(roleHierarchy);
    return expressionHandler;
}
 
開發者ID:suomenriistakeskus,項目名稱:oma-riista-web,代碼行數:7,代碼來源:SecurityConfig.java

示例15: createExpressionHandler

import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
    DefaultMethodSecurityExpressionHandler expressionHandler = new DefaultMethodSecurityExpressionHandler();
    expressionHandler.setPermissionEvaluator(permissionEvaluatorService());
    return expressionHandler;
}
 
開發者ID:leweihe,項目名稱:lewei_angul,代碼行數:7,代碼來源:GlobalMethodSecurityConfig.java


注:本文中的org.springframework.security.access.expression.method.MethodSecurityExpressionHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。