|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.io.SimpleStreamableObject
com.threerings.crowd.data.TokenRing
public class TokenRing
Defines access control tokens that convey certain privileges to users.
BodyObject.CrowdPermissionPolicy| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
protected int |
_tokens
The tokens contained in this ring (composed together bitwise). |
static int |
ADMIN
Indicates that this user is an administrator. |
| Constructor Summary | |
|---|---|
TokenRing(int tokens)
Constructs a token ring with the supplied set of tokens. |
|
| Method Summary | |
|---|---|
void |
clearToken(int token)
Clears the specified token from this ring. |
int |
getTokens()
Returns the bitmask that stores the various tokens. |
boolean |
holdsAnyToken(int tokens)
Returns true if this token ring contains any one of the specified tokens. |
boolean |
holdsToken(int token)
Returns true if this token ring contains the specified token or tokens, exactly. |
boolean |
isAdmin()
Convenience function for checking whether this ring holds the ADMIN token. |
void |
setToken(int token)
Adds the specified token to this ring. |
void |
setToken(int token,
boolean on)
Set the specified token to be on or off. |
| Methods inherited from class com.threerings.io.SimpleStreamableObject |
|---|
toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ADMIN
protected int _tokens
| Constructor Detail |
|---|
public TokenRing(int tokens)
| Method Detail |
|---|
public boolean holdsToken(int token)
public boolean holdsAnyToken(int tokens)
public boolean isAdmin()
ADMIN token.
public int getTokens()
public void setToken(int token,
boolean on)
public void setToken(int token)
public void clearToken(int token)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||