Class WindowsPrincipal

    • Constructor Detail

      • WindowsPrincipal

        public WindowsPrincipal​(IWindowsIdentity windowsIdentity)
        A windows principal.
        Parameters:
        windowsIdentity - Windows identity.
      • WindowsPrincipal

        public WindowsPrincipal​(IWindowsIdentity windowsIdentity,
                                PrincipalFormat principalFormat,
                                PrincipalFormat roleFormat)
        A windows principal.
        Parameters:
        windowsIdentity - Windows identity.
        principalFormat - Principal format.
        roleFormat - Role format.
    • Method Detail

      • getSid

        public byte[] getSid()
        Byte representation of the SID.
        Returns:
        Array of bytes.
      • getSidString

        public String getSidString()
        String representation of the SID.
        Returns:
        String.
      • getGroups

        public Map<String,​WindowsAccount> getGroups()
        Windows groups that the user is a member of.
        Returns:
        A map of group names to groups.
      • getRolesString

        public String getRolesString()
        Get an array of roles as a string.
        Returns:
        Role1, Role2, ...
      • hasRole

        public boolean hasRole​(String role)
        Checks whether the principal has a given role.
        Parameters:
        role - Role name.
        Returns:
        True if the principal has a role, false otherwise.
      • getName

        public String getName()
        Fully qualified name.
        Specified by:
        getName in interface Principal
        Returns:
        String.
      • getIdentity

        public IWindowsIdentity getIdentity()
        Underlying identity.
        Returns:
        String.