-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gh-4594-perms-bugs-and-enhancements_7.6' of github.com:…
…gchq/stroom into gh-4594_permission_inheritance
- Loading branch information
Showing
34 changed files
with
1,041 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
stroom-core-client/src/main/java/stroom/security/client/event/OpenAppPermissionsEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package stroom.security.client.event; | ||
|
||
import stroom.security.client.event.OpenAppPermissionsEvent.OpenAppPermissionsHandler; | ||
|
||
import com.google.gwt.event.shared.EventHandler; | ||
import com.google.gwt.event.shared.GwtEvent; | ||
import com.google.gwt.event.shared.HasHandlers; | ||
|
||
import java.util.Objects; | ||
|
||
public class OpenAppPermissionsEvent extends GwtEvent<OpenAppPermissionsHandler> { | ||
|
||
private static Type<OpenAppPermissionsHandler> TYPE; | ||
private final String subjectId; | ||
|
||
private OpenAppPermissionsEvent(final String subjectId) { | ||
this.subjectId = Objects.requireNonNull(subjectId); | ||
} | ||
|
||
/** | ||
* Open the named node on the nodes screen | ||
*/ | ||
public static void fire(final HasHandlers handlers, final String subjectId) { | ||
handlers.fireEvent(new OpenAppPermissionsEvent(subjectId)); | ||
} | ||
|
||
public static Type<OpenAppPermissionsHandler> getType() { | ||
if (TYPE == null) { | ||
TYPE = new Type<>(); | ||
} | ||
return TYPE; | ||
} | ||
|
||
@Override | ||
public Type<OpenAppPermissionsHandler> getAssociatedType() { | ||
return getType(); | ||
} | ||
|
||
@Override | ||
protected void dispatch(final OpenAppPermissionsHandler handler) { | ||
handler.onOpen(this); | ||
} | ||
|
||
public String getSubjectId() { | ||
return subjectId; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "OpenAppPermissionsEvent{" + | ||
"subjectId='" + subjectId + '\'' + | ||
'}'; | ||
} | ||
|
||
// -------------------------------------------------------------------------------- | ||
|
||
|
||
public interface OpenAppPermissionsHandler extends EventHandler { | ||
|
||
void onOpen(OpenAppPermissionsEvent event); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
stroom-core-client/src/main/java/stroom/security/client/event/OpenUserOrGroupEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package stroom.security.client.event; | ||
|
||
import stroom.security.client.event.OpenUserOrGroupEvent.OpenUserOrGroupHandler; | ||
import stroom.util.shared.GwtNullSafe; | ||
import stroom.util.shared.UserRef; | ||
|
||
import com.google.gwt.event.shared.EventHandler; | ||
import com.google.gwt.event.shared.GwtEvent; | ||
import com.google.gwt.event.shared.HasHandlers; | ||
|
||
import java.util.Objects; | ||
|
||
public class OpenUserOrGroupEvent extends GwtEvent<OpenUserOrGroupHandler> { | ||
|
||
private static Type<OpenUserOrGroupHandler> TYPE; | ||
private final String subjectId; | ||
|
||
private OpenUserOrGroupEvent(final String subjectId) { | ||
this.subjectId = Objects.requireNonNull(subjectId); | ||
} | ||
|
||
/** | ||
* Open the named node on the nodes screen | ||
*/ | ||
public static void fire(final HasHandlers handlers, final String subjectId) { | ||
handlers.fireEvent(new OpenUserOrGroupEvent(Objects.requireNonNull(subjectId))); | ||
} | ||
|
||
/** | ||
* Open the named node on the nodes screen | ||
*/ | ||
public static void fire(final HasHandlers handlers, final UserRef userRef) { | ||
handlers.fireEvent(new OpenUserOrGroupEvent(GwtNullSafe.requireNonNull( | ||
userRef, | ||
UserRef::getSubjectId, | ||
() -> "subjectId required"))); | ||
} | ||
|
||
public static Type<OpenUserOrGroupHandler> getType() { | ||
if (TYPE == null) { | ||
TYPE = new Type<>(); | ||
} | ||
return TYPE; | ||
} | ||
|
||
@Override | ||
public Type<OpenUserOrGroupHandler> getAssociatedType() { | ||
return getType(); | ||
} | ||
|
||
@Override | ||
protected void dispatch(final OpenUserOrGroupHandler handler) { | ||
handler.onOpen(this); | ||
} | ||
|
||
public String getSubjectId() { | ||
return subjectId; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "OpenUserOrGroupEvent{" + | ||
"subjectId='" + subjectId + '\'' + | ||
'}'; | ||
} | ||
|
||
// -------------------------------------------------------------------------------- | ||
|
||
|
||
public interface OpenUserOrGroupHandler extends EventHandler { | ||
|
||
void onOpen(OpenUserOrGroupEvent event); | ||
} | ||
} |
Oops, something went wrong.