com.threerings.presents.data
Class ClientObject.PermissionPolicy
java.lang.Object
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.
|
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 |
ClientObject.PermissionPolicy
protected ClientObject.PermissionPolicy()
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.