public class RoleUtils extends Object
Constructor and Description |
---|
RoleUtils() |
Modifier and Type | Method and Description |
---|---|
static Set<RoleModel> |
expandCompositeRoles(Set<RoleModel> roles) |
static Stream<RoleModel> |
expandCompositeRolesStream(Stream<RoleModel> roles) |
static Set<RoleModel> |
getDeepUserRoleMappings(UserModel user) |
static boolean |
hasRole(Set<RoleModel> roles,
RoleModel targetRole) |
static boolean |
hasRole(Stream<RoleModel> roles,
RoleModel targetRole) |
static boolean |
hasRoleFromGroup(GroupModel group,
RoleModel targetRole,
boolean checkParentGroup)
Checks whether the
targetRole is contained in the given group or its parents
(if requested) |
static boolean |
hasRoleFromGroup(Iterable<GroupModel> groups,
RoleModel targetRole,
boolean checkParentGroup)
Deprecated.
Use
hasRoleFromGroup(Stream, RoleModel, boolean) hasRoleFromGroup(Stream, RoleModel, boolean)} instead. |
static boolean |
hasRoleFromGroup(Stream<GroupModel> groups,
RoleModel targetRole,
boolean checkParentGroup)
Checks whether the
targetRole is contained in any of the groups or their parents
(if requested) |
static boolean |
isClientRole(RoleModel r,
ClientModel c) |
static boolean |
isMember(Set<GroupModel> groups,
GroupModel targetGroup)
Deprecated.
Use
isMember(Stream, GroupModel) isMember(Stream, GroupModel)} instead. |
static boolean |
isMember(Stream<GroupModel> groups,
GroupModel targetGroup) |
static boolean |
isRealmRole(RoleModel r) |
static boolean |
isRealmRole(RoleModel r,
RealmModel realm) |
public static boolean isMember(Set<GroupModel> groups, GroupModel targetGroup)
isMember(Stream, GroupModel)
isMember(Stream, GroupModel)} instead.groups
- targetGroup
- public static boolean isMember(Stream<GroupModel> groups, GroupModel targetGroup)
groups
- targetGroup
- public static boolean hasRole(Set<RoleModel> roles, RoleModel targetRole)
roles
- targetRole
- public static boolean hasRole(Stream<RoleModel> roles, RoleModel targetRole)
roles
- targetRole
- public static boolean hasRoleFromGroup(GroupModel group, RoleModel targetRole, boolean checkParentGroup)
targetRole
is contained in the given group or its parents
(if requested)group
- Group to check role fortargetRole
- checkParentGroup
- When true
, also parent group is recursively checked for rolepublic static boolean hasRoleFromGroup(Iterable<GroupModel> groups, RoleModel targetRole, boolean checkParentGroup)
hasRoleFromGroup(Stream, RoleModel, boolean)
hasRoleFromGroup(Stream, RoleModel, boolean)} instead.targetRole
is contained in any of the groups
or their parents
(if requested)groups
- targetRole
- checkParentGroup
- When true
, also parent group is recursively checked for rolepublic static boolean hasRoleFromGroup(Stream<GroupModel> groups, RoleModel targetRole, boolean checkParentGroup)
targetRole
is contained in any of the groups
or their parents
(if requested)groups
- targetRole
- checkParentGroup
- When true
, also parent group is recursively checked for rolepublic static Set<RoleModel> expandCompositeRoles(Set<RoleModel> roles)
roles
- public static Stream<RoleModel> expandCompositeRolesStream(Stream<RoleModel> roles)
roles
- public static Set<RoleModel> getDeepUserRoleMappings(UserModel user)
user
- public static boolean isRealmRole(RoleModel r)
public static boolean isRealmRole(RoleModel r, RealmModel realm)
public static boolean isClientRole(RoleModel r, ClientModel c)
Copyright © 2021 JBoss by Red Hat. All rights reserved.