public interface Realm
Modifier and Type | Method and Description |
---|---|
Map<String,List<String>> |
getUserAttributes(String id)
Returns all attributes associated with the a user with the given
id . |
List<String> |
getUserClientRoles(String id,
String clientId)
Returns all client roles granted for a user with the given
id . |
List<String> |
getUserGroups(String id)
Returns all groups which the user with the given
id is a member. |
List<String> |
getUserRealmRoles(String id)
Returns all realm roles granted for a user with the given
id . |
boolean |
isGroupInRole(String group,
String role)
Checks whether or not a
group is granted with the given realm role . |
boolean |
isUserInClientRole(String id,
String clientId,
String role)
Checks whether or not a user with the given
id is granted with the given client role . |
default boolean |
isUserInGroup(String id,
String group)
Checks whether or not a user with the given
id is a member of the given group . |
boolean |
isUserInGroup(String id,
String group,
boolean checkParent)
Checks whether or not a user with the given
id is a member of the given group . |
boolean |
isUserInRealmRole(String id,
String role)
Checks whether or not a user with the given
id is granted with the given realm role . |
default boolean isUserInGroup(String id, String group)
Checks whether or not a user with the given id
is a member of the given group
.
This method will also consider memberships where the user is a member of any child group of the given group
.
For instance, if user is member of /Group A/Group B
and this method is checking if user is a member of /Group A
the result will be true
given that the user is a member of a child group of /Group A
.
id
- the user id. It can be the id, username or emailgroup
- the group path. For instance, /Group A/Group B.boolean isUserInGroup(String id, String group, boolean checkParent)
id
is a member of the given group
.id
- the user id. It can be the id, username or emailgroup
- the group path. For instance, /Group A/Group B.checkParent
- if true, this method returns true even though the user is not directly associated with the given group but a member of any child of the group.boolean isUserInRealmRole(String id, String role)
id
is granted with the given realm role
.id
- the user id. It can be the id, username or emailrole
- the role nameboolean isUserInClientRole(String id, String clientId, String role)
id
is granted with the given client role
.id
- the user id. It can be the id, username or emailclientId
- the client idrole
- the role nameboolean isGroupInRole(String group, String role)
group
is granted with the given realm role
.group
- the group path. For instance, /Group A/Group B.role
- the role nameList<String> getUserRealmRoles(String id)
id
.id
- the user id. It can be the id, username or emailList<String> getUserClientRoles(String id, String clientId)
id
.id
- the user id. It can be the id, username or emailclientId
- the client idList<String> getUserGroups(String id)
id
is a member.id
- the user id. It can be the id, username or emailCopyright © 2020 JBoss by Red Hat. All rights reserved.