public class RoleUtils extends Object
Constructor and Description |
---|
RoleUtils() |
Modifier and Type | Method and Description |
---|---|
static Set<RoleModel> |
expandCompositeRoles(Set<RoleModel> roles) |
static Set<RoleModel> |
getDeepUserRoleMappings(UserModel user) |
static boolean |
hasRole(Set<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)
Checks whether the
targetRole is contained in any of the groups or their parents
(if requested) |
static boolean |
isMember(Set<GroupModel> groups,
GroupModel targetGroup) |
public static boolean isMember(Set<GroupModel> groups, GroupModel targetGroup)
groups
- targetGroup
- public static boolean hasRole(Set<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)
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
- Copyright © 2019 JBoss by Red Hat. All rights reserved.