com.threerings.presents.data
Class ClientObject.PermissionPolicy

java.lang.Object
  extended by com.threerings.presents.data.ClientObject.PermissionPolicy
All Implemented Interfaces:
InvocationCodes
Direct Known Subclasses:
BodyObject.CrowdPermissionPolicy
Enclosing class:
ClientObject

protected class ClientObject.PermissionPolicy
extends Object
implements InvocationCodes

ClientObject derived classes can extend this class to provide more sophisticated permission policies, and should return their customized classes from ClientObject.createPermissionPolicy(). This class, and its children must only make use of data available in the ClientObject (and its children). Permissions may be checked on the client or server.


Field Summary
 
Fields inherited from interface com.threerings.presents.data.InvocationCodes
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR
 
Constructor Summary
protected ClientObject.PermissionPolicy()
           
 
Method Summary
 String checkAccess(Permission perm, Object context)
          Returns null if the specified client has the specified permission, an error code explaining the lack of access if they do not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientObject.PermissionPolicy

protected ClientObject.PermissionPolicy()
Method Detail

checkAccess

public String checkAccess(Permission perm,
                          Object context)
Returns null if the specified client has the specified permission, an error code explaining the lack of access if they do not. InvocationCodes.ACCESS_DENIED should be returned if no more specific explanation is available.

Parameters:
perm - the permission to be checked.
context - a potential context for the request, if any.