in emr-user-role-mapper-s3storagebasedauthorizationmanager/src/main/java/com/amazonaws/emr/urm/hive/urmstoragebasedauthorizer/S3StorageBasedAuthorizationProvider.java [125:139]
private void authorize(Table table, Partition part, Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv)
throws HiveException, AuthorizationException {
// Partition path can be null in the case of a new create partition - in this case,
// we try to default to checking the permissions of the parent table.
// Partition itself can also be null, in cases where this gets called as a generic
// catch-all call in cases like those with CTAS onto an unpartitioned table (see HIVE-1887)
if ((part == null) || (part.getLocation() == null)) {
// this should be the case only if this is a create partition.
// The privilege needed on the table should be ALTER_DATA, and not CREATE
authorize(table, new Privilege[]{}, new Privilege[]{Privilege.ALTER_DATA});
} else {
authorize(part.getDataLocation().toString(), readRequiredPriv, writeRequiredPriv);
}
}