in emr-user-role-mapper-s3storagebasedauthorizationmanager/src/main/java/com/amazonaws/emr/urm/hive/urmstoragebasedauthorizer/S3StorageBasedAuthorizationProvider.java [253:270]
private void checkActionS3(AmazonS3 s3Client, S3Action action, String path, String userName) throws AccessControlException {
AmazonS3URI s3URIparser = new AmazonS3URI(path);
String bucketName = s3URIparser.getBucket();
String objectKey = s3URIparser.getKey();
String prefix = addSlashIfNotExists(objectKey);
if (action.equals(S3Action.READ) || action.equals(S3Action.ALL)) {
if (!getConf().getBoolean(SKIP_READ_PERMISSIONS_CONF, SKIP_READ_PERMISSIONS_DEFAULT)) {
testReadPath(s3Client, action, bucketName, prefix, userName);
}
}
//Validate if Write permissions are available with returned credentials.
if (action.equals(S3Action.WRITE) || action.equals(S3Action.ALL)) {
testWritePath(s3Client, action, userName, bucketName, prefix);
}
}