|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright 2002-2022 the original author or authors.
|
|
|
|
|
|
+ * Copyright 2002-2024 the original author or authors.
|
|
*
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -30,6 +30,7 @@ import org.springframework.util.Assert;
|
|
* For internal use only, as this contract is likely to change.
|
|
* For internal use only, as this contract is likely to change.
|
|
*
|
|
*
|
|
* @author Evgeniy Cheban
|
|
* @author Evgeniy Cheban
|
|
|
|
+ * @author DingHao
|
|
* @since 5.8
|
|
* @since 5.8
|
|
*/
|
|
*/
|
|
final class PreFilterExpressionAttributeRegistry
|
|
final class PreFilterExpressionAttributeRegistry
|
|
@@ -54,7 +55,7 @@ final class PreFilterExpressionAttributeRegistry
|
|
@Override
|
|
@Override
|
|
PreFilterExpressionAttribute resolveAttribute(Method method, Class<?> targetClass) {
|
|
PreFilterExpressionAttribute resolveAttribute(Method method, Class<?> targetClass) {
|
|
Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass);
|
|
Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass);
|
|
- PreFilter preFilter = findPreFilterAnnotation(specificMethod);
|
|
|
|
|
|
+ PreFilter preFilter = findPreFilterAnnotation(specificMethod, targetClass);
|
|
if (preFilter == null) {
|
|
if (preFilter == null) {
|
|
return PreFilterExpressionAttribute.NULL_ATTRIBUTE;
|
|
return PreFilterExpressionAttribute.NULL_ATTRIBUTE;
|
|
}
|
|
}
|
|
@@ -63,10 +64,10 @@ final class PreFilterExpressionAttributeRegistry
|
|
return new PreFilterExpressionAttribute(preFilterExpression, preFilter.filterTarget());
|
|
return new PreFilterExpressionAttribute(preFilterExpression, preFilter.filterTarget());
|
|
}
|
|
}
|
|
|
|
|
|
- private PreFilter findPreFilterAnnotation(Method method) {
|
|
|
|
|
|
+ private PreFilter findPreFilterAnnotation(Method method, Class<?> targetClass) {
|
|
PreFilter preFilter = AuthorizationAnnotationUtils.findUniqueAnnotation(method, PreFilter.class);
|
|
PreFilter preFilter = AuthorizationAnnotationUtils.findUniqueAnnotation(method, PreFilter.class);
|
|
return (preFilter != null) ? preFilter
|
|
return (preFilter != null) ? preFilter
|
|
- : AuthorizationAnnotationUtils.findUniqueAnnotation(method.getDeclaringClass(), PreFilter.class);
|
|
|
|
|
|
+ : AuthorizationAnnotationUtils.findUniqueAnnotation(targetClass(method, targetClass), PreFilter.class);
|
|
}
|
|
}
|
|
|
|
|
|
static final class PreFilterExpressionAttribute extends ExpressionAttribute {
|
|
static final class PreFilterExpressionAttribute extends ExpressionAttribute {
|