LATEST VERSION: 8.2.6 - CHANGELOG
Pivotal GemFire® v8.2

Determining Pre- or Post-Operation Authorization

Determining Pre- or Post-Operation Authorization

The OperationContext object that is passed to the authorizeOperation method of the callback as the second argument provides an isPostOperation method that returns true when the callback is invoked in the post-operation phase.

For example:
bool authorizeOperation(Region region, OperationContext context)
{
If(context.isPostOperation())
{
//It's a post-operation
}
else
{
//it's a pre-operation
}
}

If an authorization failure occurs in a pre-operation or post-operation callback on the server, the operation throws a NotAuthorizedException on the client.

For more information, see Authorization in the GemFire User’s Guide.