org.springframework.security.access.expression.SecurityExpressionHandler Java Examples

The following examples show how to use org.springframework.security.access.expression.SecurityExpressionHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SecurityDialectPostProcessor.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 5 votes vote down vote up
@Override
public Object postProcessBeforeInitialization(
	Object bean, String beanName) throws BeansException {
	if (bean instanceof SpringTemplateEngine) {
		SpringTemplateEngine engine =
					(SpringTemplateEngine) bean;
		SecurityExpressionHandler<MethodInvocation> handler =
			applicationContext.getBean(
							SecurityExpressionHandler.class);
		SecurityDialect dialect = new SecurityDialect(handler);
		engine.addDialect(dialect);
	}
	return bean;
}
 
Example #2
Source File: SecurityDialectPostProcessor.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 5 votes vote down vote up
@Override
public Object postProcessBeforeInitialization(
	Object bean, String beanName) throws BeansException {
	if (bean instanceof SpringTemplateEngine) {
		SpringTemplateEngine engine =
					(SpringTemplateEngine) bean;
		SecurityExpressionHandler<MethodInvocation> handler =
			applicationContext.getBean(
							SecurityExpressionHandler.class);
		SecurityDialect dialect = new SecurityDialect(handler);
		engine.addDialect(dialect);
	}
	return bean;
}
 
Example #3
Source File: SecurityConfiguration.java    From SMSC with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the {@link SecurityExpressionHandler} which is used for role hierarchy definition
 *
 * @return authenticationTokenFilter
 */
private SecurityExpressionHandler<FilterInvocation> expressionHandler() {
    DefaultWebSecurityExpressionHandler defaultWebSecurityExpressionHandler = new DefaultWebSecurityExpressionHandler();
    defaultWebSecurityExpressionHandler.setRoleHierarchy(roleHierarchy());

    return defaultWebSecurityExpressionHandler;
}
 
Example #4
Source File: SecurityMetadataManager.java    From we-cmdb with Apache License 2.0 4 votes vote down vote up
public void setSecurityExpressionHandler(SecurityExpressionHandler<FilterInvocation> securityExpressionHandler) {
    this.securityExpressionHandler = securityExpressionHandler;
}
 
Example #5
Source File: SecurityExpressionObjectFactory.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
public SecurityExpressionObjectFactory(
	SecurityExpressionHandler<MethodInvocation> handler) {
	this.handler = handler;
}
 
Example #6
Source File: Authorization.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
public Authorization(ISpringWebFluxContext context,
	SecurityExpressionHandler<MethodInvocation> handler) {
	this.context = context;
	this.handler = handler;
}
 
Example #7
Source File: SecurityDialect.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
public SecurityDialect(
	SecurityExpressionHandler<MethodInvocation> handler) {
	super("Security Dialect");
	this.handler = handler;
}
 
Example #8
Source File: SecurityExpressionObjectFactory.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
public SecurityExpressionObjectFactory(
	SecurityExpressionHandler<MethodInvocation> handler) {
	this.handler = handler;
}
 
Example #9
Source File: Authorization.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
public Authorization(ISpringWebFluxContext context,
	SecurityExpressionHandler<MethodInvocation> handler) {
	this.context = context;
	this.handler = handler;
}
 
Example #10
Source File: SecurityDialect.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
public SecurityDialect(
	SecurityExpressionHandler<MethodInvocation> handler) {
	super("Security Dialect");
	this.handler = handler;
}
 
Example #11
Source File: OpenApiSecurityConfigurer.java    From spring-backend-boilerplate with Apache License 2.0 4 votes vote down vote up
@Bean
public SecurityExpressionHandler rbacWebSecurityExpressionHandler() {
    return new RbacWebSecurityExpressionHandler();
}
 
Example #12
Source File: MultiWebExpressionVoter.java    From onetwo with Apache License 2.0 4 votes vote down vote up
public void setExpressionHandler(
		SecurityExpressionHandler<FilterInvocation> expressionHandler) {
	this.expressionHandler = expressionHandler;
}
 
Example #13
Source File: MethodWebExpressionVoter.java    From onetwo with Apache License 2.0 4 votes vote down vote up
public void setExpressionHandler(SecurityExpressionHandler<MethodInvocation> expressionHandler) {
	this.expressionHandler = expressionHandler;
}