You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/servlet/authorization/events.adoc
+21-66Lines changed: 21 additions & 66 deletions
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ Because ``AuthorizationGrantedEvent``s have the potential to be quite noisy, the
74
74
75
75
In fact, publishing these events will likely require some business logic on your part to ensure that your application is not inundated with noisy authorization events.
76
76
77
-
You can create your own event publisher that filters success events.
77
+
You can provide your own predicate that filters success events.
78
78
For example, the following publisher only publishes authorization grants where `ROLE_ADMIN` was required:
79
79
80
80
[tabs]
@@ -83,86 +83,41 @@ Java::
83
83
+
84
84
[source,java,role="primary"]
85
85
----
86
-
@Component
87
-
public class MyAuthorizationEventPublisher implements AuthorizationEventPublisher {
88
-
private final ApplicationEventPublisher publisher;
89
-
private final AuthorizationEventPublisher delegate;
90
-
91
-
public MyAuthorizationEventPublisher(ApplicationEventPublisher publisher) {
92
-
this.publisher = publisher;
93
-
this.delegate = new SpringAuthorizationEventPublisher(publisher);
94
-
}
95
-
96
-
@Override
97
-
public <T> void publishAuthorizationEvent(Supplier<Authentication> authentication,
0 commit comments