Class UserModelIdentity
java.lang.Object
org.keycloak.authorization.common.UserModelIdentity
- All Implemented Interfaces:
Identity
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes or claims associated with this identity.getId()
Returns the unique identifier of this identity.boolean
hasClientRole
(String clientId, String roleName) Indicates if this identity is granted with a client role with the givenroleName
.boolean
hasOneClientRole
(String clientId, String... roleNames) Indicates if this identity is granted with a client role of one of the givenroleNames
.boolean
hasRealmRole
(String roleName) Indicates if this identity is granted with a realm role with the givenroleName
.
-
Field Details
-
realm
-
user
-
-
Constructor Details
-
UserModelIdentity
-
-
Method Details
-
getId
Description copied from interface:Identity
Returns the unique identifier of this identity. -
getAttributes
Description copied from interface:Identity
Returns the attributes or claims associated with this identity.- Specified by:
getAttributes
in interfaceIdentity
- Returns:
- the attributes or claims associated with this identity
-
hasRealmRole
Description copied from interface:Identity
Indicates if this identity is granted with a realm role with the givenroleName
.- Specified by:
hasRealmRole
in interfaceIdentity
- Parameters:
roleName
- the name of the role- Returns:
- true if the identity has the given role. Otherwise, it returns false.
-
hasOneClientRole
Description copied from interface:Identity
Indicates if this identity is granted with a client role of one of the givenroleNames
.- Specified by:
hasOneClientRole
in interfaceIdentity
- Parameters:
clientId
- the client idroleNames
- list- Returns:
- true if the identity has any of the given roles. Otherwise, it returns false.
-
hasClientRole
Description copied from interface:Identity
Indicates if this identity is granted with a client role with the givenroleName
.- Specified by:
hasClientRole
in interfaceIdentity
- Parameters:
clientId
- the client idroleName
- the name of the role- Returns:
- true if the identity has the given role. Otherwise, it returns false.
-