# UserPrincipal

public interface **UserPrincipal** implements [Principal](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html)

|---|---|---|
| Known Indirect Subclasses [GroupPrincipal](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/GroupPrincipal.html) |---|---| | [GroupPrincipal](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/GroupPrincipal.html) | A `UserPrincipal` representing a *group identity*, used to determine access rights to objects in a file system. | |||

A `Principal` representing an identity used to determine access rights
to objects in a file system.

On many platforms and file systems an entity requires appropriate access
rights or permissions in order to access objects in a file system. The
access rights are generally performed by checking the identity of the entity.
For example, on implementations that use Access Control Lists (ACLs) to
enforce privilege separation then a file in the file system may have an
associated ACL that determines the access rights of identities specified in
the ACL.

A `UserPrincipal` object is an abstract representation of an
identity. It has a `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html#getName()` that is typically the username or
account name that it represents. User principal objects may be obtained using
a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalLookupService.html`, or returned by `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/FileAttributeView.html` implementations that provide access to identity related
attributes. For example, the `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/AclFileAttributeView.html` and `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/PosixFileAttributeView.html` provide access to a file's `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/PosixFileAttributes.html#owner()`.

### Inherited Method Summary

From interface [java.security.Principal](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html)

|---|---|
| abstract boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) another) Compares this principal to the specified object. |
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getName](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html#getName())() Returns the name of this principal. |
| abstract int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html#hashCode())() Returns a hashcode for this principal. |
| boolean | [implies](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html#implies(javax.security.auth.Subject))([Subject](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/auth/Subject.html) subject) Returns true if the specified subject is implied by this principal. |
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Principal.html#toString())() Returns a string representation of this principal. |