Put the basis for the token ring authentication stuff into Narya as we are
now using it in Yohoho, Game Gardens and Bang. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3552 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -92,13 +92,23 @@ public class BodyObject extends ClientObject
|
||||
public String checkAccess (String feature, Object context)
|
||||
{
|
||||
// our default access control policy; how quaint
|
||||
if (ChatCodes.CHAT_ACCESS.equals(feature)) {
|
||||
if (ChatCodes.BROADCAST_ACCESS.equals(feature)) {
|
||||
return getTokens().isAdmin() ? null : ChatCodes.ACCESS_DENIED;
|
||||
} else if (ChatCodes.CHAT_ACCESS.equals(feature)) {
|
||||
return null;
|
||||
} else {
|
||||
return InvocationCodes.ACCESS_DENIED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this user's access control tokens.
|
||||
*/
|
||||
public TokenRing getTokens ()
|
||||
{
|
||||
return EMPTY_TOKENS;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void applyToListeners (ListenerOp op)
|
||||
{
|
||||
@@ -181,4 +191,7 @@ public class BodyObject extends ClientObject
|
||||
this.awayMessage = value;
|
||||
}
|
||||
// AUTO-GENERATED: METHODS END
|
||||
|
||||
/** The default (no tokens) access control. */
|
||||
protected static final TokenRing EMPTY_TOKENS = new TokenRing();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user