* Checks if the user in the given context is valid for this repository and
* if the user has the required permissions.
*/
private boolean checkUser(CallContext context, boolean writeRequired) {
if (context == null) {
throw new CmisPermissionDeniedException("No user context!");
}
Boolean readOnly = fUserMap.get(context.getUsername());
if (readOnly == null) {
throw new CmisPermissionDeniedException("Unknown user!");
}
if (readOnly.booleanValue() && writeRequired) {
throw new CmisPermissionDeniedException("No write permission!");
}
return readOnly.booleanValue();
}