THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
@Override public boolean authorizeOperationauthorize(StringPrincipal regionNameprincipal, OperationContextGeodePermission contextpermission) { switch (context.getOperationCode()) { case PUT: // cast to PutOperationContext breakResource resource = permission.getResource(); Operation operation case QUERY: // cast to QueryOperationContext break= permission.getOperation(); case READ:if(principalHasAccessToPerformGivenOperationOnGivenResource() { case WRITE: case MANAGE: // Must be JMX or CLI - no need to cast; just use the 'context' as is breakreturn true; } return false; } |
Note that any JMX or CLI contexts are not associated with a specific sub-type of OperationContext and can be handled without having to cast the context parameter.
...