public class RoleUtils extends Object
| Constructor and Description | 
|---|
RoleUtils()  | 
| Modifier and Type | Method and Description | 
|---|---|
static Stream<RoleModel> | 
expandCompositeRolesStream(RoleModel role)
Recursively expands composite roles into their composite. 
 | 
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 roleCopyright © 2018 JBoss by Red Hat. All rights reserved.