15
15
import java .util .Optional ;
16
16
import org .slf4j .Logger ;
17
17
import org .slf4j .LoggerFactory ;
18
- import org .springframework .security .access .expression .SecurityExpressionRoot ;
19
- import org .springframework .security .access .expression .method .MethodSecurityExpressionOperations ;
20
- import org .springframework .security .core .Authentication ;
21
18
22
- public abstract class AbacMethodSecurityExpressionRoot extends SecurityExpressionRoot implements
23
- MethodSecurityExpressionOperations {
19
+ public abstract class AbacMethodSecurityExpression {
24
20
25
- private static final Logger LOGGER = LoggerFactory .getLogger (AbacMethodSecurityExpressionRoot .class );
26
-
27
- private Object filterObject ;
28
- private Object returnObject ;
21
+ private static final Logger LOGGER = LoggerFactory .getLogger (AbacMethodSecurityExpression .class );
29
22
30
23
private PdpClient pdpClient ;
31
24
32
- /**
33
- * Creates a new instance
34
- *
35
- * @param authentication the {@link Authentication} to use. Cannot be null.
36
- * @param pdpClient the {@link PdpClient}
37
- */
38
- public AbacMethodSecurityExpressionRoot (Authentication authentication , PdpClient pdpClient ) {
39
- super (authentication );
25
+ public AbacMethodSecurityExpression (PdpClient pdpClient ) {
40
26
this .pdpClient = pdpClient ;
41
27
}
42
28
@@ -65,7 +51,6 @@ private Request getAllCategoriesRequest(String attributeId, List<Object> values)
65
51
return request ;
66
52
}
67
53
68
-
69
54
private boolean isPermitted (Response response ) {
70
55
final boolean isPermitted = "Permit" .equals (response .getResults ().get (0 ).getDecision ());
71
56
LOGGER .debug ("isPermitted: {}" , isPermitted );
@@ -81,31 +66,6 @@ private ResourceCategory createResourceCategoryRequest(String attributeId, List<
81
66
return resourceCategory ;
82
67
}
83
68
84
- @ Override
85
- public void setFilterObject (Object filterObject ) {
86
- this .filterObject = filterObject ;
87
- }
88
-
89
- @ Override
90
- public Object getFilterObject () {
91
- return filterObject ;
92
- }
93
-
94
- @ Override
95
- public void setReturnObject (Object returnObject ) {
96
- this .returnObject = returnObject ;
97
- }
98
-
99
- @ Override
100
- public Object getReturnObject () {
101
- return returnObject ;
102
- }
103
-
104
- @ Override
105
- public Object getThis () {
106
- return this ;
107
- }
108
-
109
69
protected Optional <List <AccessSubjectCategory >> addAccessSubjectCategoryRequest () {
110
70
return Optional .empty ();
111
71
}
0 commit comments