Class TrustedIdentityProvider

  • All Implemented Interfaces:
    IdentityProvider

    public class TrustedIdentityProvider
    extends Object
    implements IdentityProvider
    Trusted identity provider is intended to be used by system wide operations that might not have any security context attached e.g. timer expiration, messaging consumers etc. Trusted identity is considered an admin so it can perform any operation
    • Constructor Detail

      • TrustedIdentityProvider

        public TrustedIdentityProvider​(String name)
    • Method Detail

      • isAdmin

        public boolean isAdmin()
        Description copied from interface: IdentityProvider
        Checks if given identity is an admin
        Specified by:
        isAdmin in interface IdentityProvider
        Returns:
        returns true if the identity has admin rights otherwise false
      • getName

        public String getName()
        Description copied from interface: IdentityProvider
        Returns name assigned to the current context, usually refers to user name
        Specified by:
        getName in interface IdentityProvider
        Returns:
        assigned name taken from security context
      • getRoles

        public List<String> getRoles()
        Description copied from interface: IdentityProvider
        Returns roles assigned to the current context if any
        Specified by:
        getRoles in interface IdentityProvider
        Returns:
        list of assigned roles or empty list
      • hasRole

        public boolean hasRole​(String role)
        Description copied from interface: IdentityProvider
        Checks if given role is assigned to current context
        Specified by:
        hasRole in interface IdentityProvider
        Parameters:
        role - role to be checked
        Returns:
        true if the role is found otherwise null