public int vote(Authentication authentication, MethodInvocation method, Collection<ConfigAttribute> attributes) { // Find prefilter and preauth (or combined) attributes // if both null, abstain // else call advice with them PreInvocationAttribute preAttr = findPreInvocationAttribute(attributes); if (preAttr == null) { // No expression based metadata, so abstain return ACCESS_ABSTAIN; } boolean allowed = preAdvice.before(authentication, method, preAttr); return allowed ? ACCESS_GRANTED : ACCESS_DENIED; }
public int vote(Authentication authentication, MethodInvocation method, Collection<ConfigAttribute> attributes) { // Find prefilter and preauth (or combined) attributes // if both null, abstain // else call advice with them PreInvocationAttribute preAttr = findPreInvocationAttribute(attributes); if (preAttr == null) { // No expression based metadata, so abstain return ACCESS_ABSTAIN; } boolean allowed = preAdvice.before(authentication, method, preAttr); return allowed ? ACCESS_GRANTED : ACCESS_DENIED; }
.map(SecurityContext::getAuthentication) .defaultIfEmpty(this.anonymous) .filter( auth -> this.preInvocationAdvice.before(auth, invocation, preAttr)) .switchIfEmpty(Mono.defer(() -> Mono.error(new AccessDeniedException("Denied"))));
.map(SecurityContext::getAuthentication) .defaultIfEmpty(this.anonymous) .filter( auth -> this.preInvocationAdvice.before(auth, invocation, preAttr)) .switchIfEmpty(Mono.defer(() -> Mono.error(new AccessDeniedException("Denied"))));
public int vote(Authentication authentication, MethodInvocation method, Collection<ConfigAttribute> attributes) { // Find prefilter and preauth (or combined) attributes // if both null, abstain // else call advice with them PreInvocationAttribute preAttr = findPreInvocationAttribute(attributes); if (preAttr == null) { // No expression based metadata, so abstain return ACCESS_ABSTAIN; } boolean allowed = preAdvice.before(authentication, method, preAttr); return allowed ? ACCESS_GRANTED : ACCESS_DENIED; }
public int vote(Authentication authentication, MethodInvocation method, Collection<ConfigAttribute> attributes) { // Find prefilter and preauth (or combined) attributes // if both null, abstain // else call advice with them PreInvocationAttribute preAttr = findPreInvocationAttribute(attributes); if (preAttr == null) { // No expression based metadata, so abstain return ACCESS_ABSTAIN; } boolean allowed = preAdvice.before(authentication, method, preAttr); return allowed ? ACCESS_GRANTED : ACCESS_DENIED; }
.map(SecurityContext::getAuthentication) .defaultIfEmpty(this.anonymous) .filter( auth -> this.preInvocationAdvice.before(auth, invocation, preAttr)) .switchIfEmpty(Mono.defer(() -> Mono.error(new AccessDeniedException("Denied"))));