public class RestrictionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasPrivilege(Privilege privilege,
UserInfo user,
String event)
Returns
true if and only if the given user matches the given privilege for the given event, i.e. |
static boolean |
passesRestriction(Restriction restriction,
UserInfo user,
String event)
Returns
true if and only if the given user passes the given Restriction for the given event, i.e. |
static Stream<Privilege> |
passingPrivilegesOfRestriction(Restriction restriction,
UserInfo user,
String event)
Returns all
Privileges of the passed Restriction which are passed by the current UserInfo with given event. |
public static boolean passesRestriction(Restriction restriction, UserInfo user, String event)
true if and only if the given user passes the given Restriction for the given event, i.e.
at least one of the privileges of the restriction is matched.restriction - The Restriction to be testeduser - The user to be testedevent - The event to be testedtrue if and only if the given user passes the given restriction for the eventpublic static Stream<Privilege> passingPrivilegesOfRestriction(Restriction restriction, UserInfo user, String event)
Privileges of the passed Restriction which are passed by the current UserInfo with given event.restriction - The Restriction to be analyzeduser - The user to be testedevent - The event to be testedpublic static boolean hasPrivilege(Privilege privilege, UserInfo user, String event)
true if and only if the given user matches the given privilege for the given event, i.e.
the privilege grants the event and the user provides an matching role.privilege - The privilege to be testeduser - The user to be testedevent - The event to be testedtrue if and only if the given user matches the given privilegeCopyright © 2021. All rights reserved.