Package org.apache.wiki.auth
Class GroupPrincipal
java.lang.Object
org.apache.wiki.auth.GroupPrincipal
- All Implemented Interfaces:
java.security.Principal
public final class GroupPrincipal extends java.lang.Object implements java.security.Principal
Immutable Principal that represents a Group. GroupPrincipals are injected
into a Subject's principal list at the time of authentication (login), and
serve as proxies for Group objects for the purposes of making Java 2 security
policy decisions. We add GroupPrincipals instead of the actual Groups because
calling classes should never be able to obtain a mutable object (Group
memberships can be changed by callers). Administrators who wish to grant
privileges to specific wiki groups via the security policy file should always specify
principals of type GroupPrincipal.
- Since:
- 2.3.79
- See Also:
Group
-
Constructor Summary
Constructors Constructor Description GroupPrincipal(java.lang.String group)Constructs a new GroupPrincipal object with a supplied name. -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)Two GroupPrincipals are equal if their names are equal.java.lang.StringgetName()Returns the name of the group principal.inthashCode()Returns the hashcode for this object.java.lang.StringtoString()Returns a string representation of this object.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.security.Principal
implies
-
Constructor Details
-
GroupPrincipal
Constructs a new GroupPrincipal object with a supplied name.- Parameters:
group- the wiki group; cannot benull
-
-
Method Details
-
getName
Returns the name of the group principal.- Specified by:
getNamein interfacejava.security.Principal- Returns:
- the name
- See Also:
Principal.getName()
-
equals
Two GroupPrincipals are equal if their names are equal.- Specified by:
equalsin interfacejava.security.Principal- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to compare- Returns:
- the result of the equality test
- See Also:
Object.equals(java.lang.Object)
-
hashCode
Returns the hashcode for this object.- Specified by:
hashCodein interfacejava.security.Principal- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code
- See Also:
Object.hashCode()
-
toString
Returns a string representation of this object.- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object- Returns:
- the string
- See Also:
Object.toString()
-