Search in sources :

Example 1 with SetObjectAclRequest

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));
}
Also used : AccessControlList(com.emc.object.s3.bean.AccessControlList) Grant(com.emc.object.s3.bean.Grant) SetObjectAclRequest(com.emc.object.s3.request.SetObjectAclRequest) CanonicalUser(com.emc.object.s3.bean.CanonicalUser)

Aggregations

AccessControlList (com.emc.object.s3.bean.AccessControlList)1 CanonicalUser (com.emc.object.s3.bean.CanonicalUser)1 Grant (com.emc.object.s3.bean.Grant)1 SetObjectAclRequest (com.emc.object.s3.request.SetObjectAclRequest)1