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:
Michael Bayne
2005-05-16 04:51:11 +00:00
parent a40de2ec51
commit c2ab172503
2 changed files with 108 additions and 1 deletions
@@ -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();
}