本文整理匯總了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;
}
示例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;
}
示例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();
}
};
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例13: createExpressionHandler
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
return new Zg2proSecurityExpressionHandler();
}
示例14: createExpressionHandler
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
DefaultMethodSecurityExpressionHandler expressionHandler = new CustomMethodSecurityExpressionHandler();
expressionHandler.setRoleHierarchy(roleHierarchy);
return expressionHandler;
}
示例15: createExpressionHandler
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; //導入依賴的package包/類
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
DefaultMethodSecurityExpressionHandler expressionHandler = new DefaultMethodSecurityExpressionHandler();
expressionHandler.setPermissionEvaluator(permissionEvaluatorService());
return expressionHandler;
}