Source:
public boolean checkAccess(OzoneObj ozObject, RequestContext context) throws OMException { Objects.requireNonNull(ozObject); Objects.requireNonNull(context); Objects.requireNonNull(context.getClientUgi()); String volume = ozObject.getVolumeName(); String bucket = ozObject.getBucketName(); String keyName = ozObject.getKeyName(); String objectKey = metadataManager.getOzoneKey(volume, bucket, keyName); OmKeyArgs args = new OmKeyArgs.Builder() .setVolumeName(volume) .setBucketName(bucket) .setKeyName(keyName) .build(); metadataManager.getLock().acquireReadLock(BUCKET_LOCK, volume, bucket); try { validateBucket(volume, bucket); OmKeyInfo keyInfo; if (ozObject.getResourceType() == OPEN_KEY) { keyInfo = metadataManager.getOpenKeyTable().get(objectKey); } else { try { OzoneFileStatus fileStatus = getFileStatus(args); keyInfo = fileStatus.getKeyInfo(); } catch (Exception e) { throw new OMException("Key not found, checkAccess failed. Key:" + objectKey, KEY_NOT_FOUND); } } if (keyInfo == null) { if (LOG.isDebugEnabled()) { LOG.debug("key:{} is non-existent parent, permit access to user:{}", keyName, context.getClientUgi()); } return true; } boolean hasAccess = OzoneAclUtil.checkAclRight( keyInfo.getAcls(), context); if (LOG.isDebugEnabled()) { LOG.debug("user:{} has access rights for key:{} :{} ", context.getClientUgi(), ozObject.getKeyName(), hasAccess); } return hasAccess; } catch (IOException ex) { if(ex instanceof OMException) { throw (OMException) ex; } LOG.error("CheckAccess operation failed for key:{}/{}/{}", volume, bucket, keyName, ex); throw new OMException("Check access operation failed for " + "key:" + keyName, ex, INTERNAL_ERROR); } finally { metadataManager.getLock().releaseReadLock(BUCKET_LOCK, volume, bucket); } }

Target:
public boolean checkAccess(OzoneObj ozObject, RequestContext context) throws OMException { Objects.requireNonNull(ozObject); Objects.requireNonNull(context); Objects.requireNonNull(context.getClientUgi()); String volume = ozObject.getVolumeName(); String bucket = ozObject.getBucketName(); String keyName = ozObject.getKeyName(); String objectKey = metadataManager.getOzoneKey(volume, bucket, keyName); OmKeyArgs args = new OmKeyArgs.Builder() .setVolumeName(volume) .setBucketName(bucket) .setKeyName(keyName) .build(); metadataManager.getLock().acquireReadLock(BUCKET_LOCK, volume, bucket); try { validateBucket(volume, bucket); OmKeyInfo keyInfo; if (ozObject.getResourceType() == OPEN_KEY) { keyInfo = metadataManager.getOpenKeyTable().get(objectKey); } else { try { OzoneFileStatus fileStatus = getFileStatus(args); keyInfo = fileStatus.getKeyInfo(); } catch (IOException e) { throw new OMException("Key not found, checkAccess failed. Key:" + objectKey, KEY_NOT_FOUND); } } if (keyInfo == null) { if (LOG.isDebugEnabled()) { LOG.debug("key:{} is non-existent parent, permit access to user:{}", keyName, context.getClientUgi()); } return true; } boolean hasAccess = OzoneAclUtil.checkAclRight( keyInfo.getAcls(), context); if (LOG.isDebugEnabled()) { LOG.debug("user:{} has access rights for key:{} :{} ", context.getClientUgi(), ozObject.getKeyName(), hasAccess); } return hasAccess; } catch (IOException ex) { if(ex instanceof OMException) { throw (OMException) ex; } LOG.error("CheckAccess operation failed for key:{}/{}/{}", volume, bucket, keyName, ex); throw new OMException("Check access operation failed for " + "key:" + keyName, ex, INTERNAL_ERROR); } finally { metadataManager.getLock().releaseReadLock(BUCKET_LOCK, volume, bucket); } }