|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.auth.authorize.Role
public final class Role
A lightweight, immutable Principal that represents a built-in wiki role such
as Anonymous, Asserted and Authenticated. It can also represent dynamic roles
used by an external Authorizer
, such as a web
container.
Field Summary | |
---|---|
static Role |
ALL
All users, regardless of authentication status |
static Role |
ANONYMOUS
If the user hasn't supplied a name |
static Role |
ASSERTED
If the user has supplied a cookie with a username |
static Role |
AUTHENTICATED
If the user has authenticated with the Container or UserDatabase |
Constructor Summary | |
---|---|
protected |
Role()
Create an empty Role. |
|
Role(String name)
Constructs a new Role with a given name. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Two Role objects are considered equal if their names are identical. |
String |
getName()
Returns the name of the Principal. |
int |
hashCode()
Returns a unique hashcode for the Role. |
static boolean |
isBuiltInRole(Role role)
Returns true if a supplied Role is a built-in Role:
ALL , ANONYMOUS , ASSERTED ,
or AUTHENTICATED . |
static boolean |
isReservedName(String name)
Returns true if the supplied name is identical to the name
of a built-in Role; that is, the value returned by getName()
for built-in Roles ALL , ANONYMOUS ,
ASSERTED , or AUTHENTICATED . |
String |
toString()
Returns a String representation of the role |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Role ALL
public static final Role ANONYMOUS
public static final Role ASSERTED
public static final Role AUTHENTICATED
Constructor Detail |
---|
protected Role()
public Role(String name)
name
- the name of the RoleMethod Detail |
---|
public static boolean isBuiltInRole(Role role)
true
if a supplied Role is a built-in Role:
ALL
, ANONYMOUS
, ASSERTED
,
or AUTHENTICATED
.
role
- the role to check
public static boolean isReservedName(String name)
true
if the supplied name is identical to the name
of a built-in Role; that is, the value returned by getName()
for built-in Roles ALL
, ANONYMOUS
,
ASSERTED
, or AUTHENTICATED
.
name
- the name to be tested
true
if the name is reserved; false
if notpublic int hashCode()
hashCode
in interface Principal
hashCode
in class Object
public boolean equals(Object obj)
equals
in interface Principal
equals
in class Object
obj
- the object to test
true
if both objects are of type Role and have identical namesObject.equals(java.lang.Object)
public String getName()
getName
in interface Principal
public String toString()
toString
in interface Principal
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |