Class UserModelIdentity

  • All Implemented Interfaces:
    org.keycloak.authorization.identity.Identity

    public class UserModelIdentity
    extends Object
    implements org.keycloak.authorization.identity.Identity
    Version:
    $Revision: 1 $
    Author:
    Bill Burke
    • Field Detail

      • realm

        protected org.keycloak.models.RealmModel realm
      • user

        protected org.keycloak.models.UserModel user
    • Constructor Detail

      • UserModelIdentity

        public UserModelIdentity​(org.keycloak.models.RealmModel realm,
                                 org.keycloak.models.UserModel user)
    • Method Detail

      • getId

        public String getId()
        Specified by:
        getId in interface org.keycloak.authorization.identity.Identity
      • getAttributes

        public org.keycloak.authorization.attribute.Attributes getAttributes()
        Specified by:
        getAttributes in interface org.keycloak.authorization.identity.Identity
      • hasRealmRole

        public boolean hasRealmRole​(String roleName)
        Specified by:
        hasRealmRole in interface org.keycloak.authorization.identity.Identity
      • hasOneClientRole

        public boolean hasOneClientRole​(String clientId,
                                        String... roleNames)
        Specified by:
        hasOneClientRole in interface org.keycloak.authorization.identity.Identity
      • hasClientRole

        public boolean hasClientRole​(String clientId,
                                     String roleName)
        Specified by:
        hasClientRole in interface org.keycloak.authorization.identity.Identity