Skip to content

Commit 4d580f6

Browse files
committed
Remove instance scoped events from the tenant view dialog and edit / add UI.
FusionAuth/fusionauth-issues#1593
1 parent b611cfe commit 4d580f6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main/java/io/fusionauth/domain/EventConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public int hashCode() {
5858

5959
public EventConfiguration normalize() {
6060
events.forEach((key, value) -> value.transactionType = key.isTransactionalEvent() ? value.transactionType : TransactionType.None);
61+
events.keySet().removeIf(EventType::isInstanceEvent);
6162
return this;
6263
}
6364

src/main/java/io/fusionauth/domain/event/EventType.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2020, FusionAuth, All Rights Reserved
2+
* Copyright (c) 2018-2022, FusionAuth, All Rights Reserved
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -171,6 +171,15 @@ public String eventName() {
171171
return eventName;
172172
}
173173

174+
public boolean isInstanceEvent() {
175+
try {
176+
return Class.forName(getClass().getPackage().getName() + "." + name() + "Event").getConstructor().newInstance() instanceof InstanceEvent;
177+
} catch (Exception ignore) {
178+
}
179+
180+
return false;
181+
}
182+
174183
public boolean isTransactionalEvent() {
175184
try {
176185
return !(Class.forName(getClass().getPackage().getName() + "." + name() + "Event").getConstructor().newInstance() instanceof NonTransactionalEvent);

0 commit comments

Comments
 (0)