use of com.emc.object.s3.request.SetObjectAclRequest in project pravega by pravega.
the class ExtendedS3Storage method setPermission.
private void setPermission(SegmentHandle handle, Permission permission) {
AccessControlList acl = client.getObjectAcl(config.getBucket(), config.getRoot() + handle.getSegmentName());
acl.getGrants().clear();
acl.addGrants(new Grant(new CanonicalUser(config.getAccessKey(), config.getAccessKey()), permission));
client.setObjectAcl(new SetObjectAclRequest(config.getBucket(), config.getRoot() + handle.getSegmentName()).withAcl(acl));
}
Aggregations