Exemple #1
0
 @Override
 public List<Grant> apply(OwnerIdPair ownerIds) {
   List<Grant> grants = PrivateOnlyGrantBuilder.INSTANCE.apply(ownerIds);
   Grantee grantee = new Grantee();
   grantee.setGroup(new Group(ObjectStorageProperties.S3_GROUP.EC2_BUNDLE_READ.toString()));
   Grant grant = new Grant();
   grant.setPermission(ObjectStorageProperties.Permission.READ.toString());
   grant.setGrantee(grantee);
   grants.add(grant);
   return grants;
 }
Exemple #2
0
 @Override
 public List<Grant> apply(OwnerIdPair ownerIds) {
   List<Grant> awsExecRead = PrivateOnlyGrantBuilder.INSTANCE.apply(ownerIds);
   Grantee execReadGroup = new Grantee();
   execReadGroup.setGroup(new Group(ObjectStorageProperties.S3_GROUP.AWS_EXEC_READ.toString()));
   Grant execReadGrant = new Grant();
   execReadGrant.setPermission(ObjectStorageProperties.Permission.READ.toString());
   execReadGrant.setGrantee(execReadGroup);
   awsExecRead.add(execReadGrant);
   return awsExecRead;
 }
Exemple #3
0
 @Override
 public List<Grant> apply(OwnerIdPair ownerIds) {
   List<Grant> publicRead = PrivateOnlyGrantBuilder.INSTANCE.apply(ownerIds);
   Grantee allUsers = new Grantee();
   allUsers.setGroup(new Group(ObjectStorageProperties.S3_GROUP.ALL_USERS_GROUP.toString()));
   Grant allUsersGrant = new Grant();
   allUsersGrant.setPermission(ObjectStorageProperties.Permission.READ.toString());
   allUsersGrant.setGrantee(allUsers);
   publicRead.add(allUsersGrant);
   return publicRead;
 }
Exemple #4
0
 @Override
 public List<Grant> apply(OwnerIdPair ownerIds) {
   List<Grant> authenticatedRead = PrivateOnlyGrantBuilder.INSTANCE.apply(ownerIds);
   Grantee authenticatedUsers = new Grantee();
   authenticatedUsers.setGroup(
       new Group(ObjectStorageProperties.S3_GROUP.AUTHENTICATED_USERS_GROUP.toString()));
   Grant authUsersGrant = new Grant();
   authUsersGrant.setPermission(ObjectStorageProperties.Permission.READ.toString());
   authUsersGrant.setGrantee(authenticatedUsers);
   authenticatedRead.add(authUsersGrant);
   return authenticatedRead;
 }
Exemple #5
0
    @Override
    public List<Grant> apply(OwnerIdPair ownerIds) {
      List<Grant> logDeliveryWrite = PrivateOnlyGrantBuilder.INSTANCE.apply(ownerIds);
      Grantee logGroup = new Grantee();
      logGroup.setGroup(new Group(ObjectStorageProperties.S3_GROUP.LOGGING_GROUP.toString()));

      Grant loggingWriteGrant = new Grant();
      loggingWriteGrant.setPermission(ObjectStorageProperties.Permission.WRITE.toString());
      loggingWriteGrant.setGrantee(logGroup);

      Grant loggingReadAcpGrant = new Grant();
      loggingReadAcpGrant.setPermission(ObjectStorageProperties.Permission.READ_ACP.toString());
      loggingReadAcpGrant.setGrantee(logGroup);

      logDeliveryWrite.add(loggingWriteGrant);
      logDeliveryWrite.add(loggingReadAcpGrant);
      return logDeliveryWrite;
    }
Exemple #6
0
    @Override
    public List<Grant> apply(OwnerIdPair ownerIds) {
      List<Grant> bucketOwnerRead = PrivateOnlyGrantBuilder.INSTANCE.apply(ownerIds);
      String canonicalId = ownerIds.getBucketOwnerCanonicalId();
      String displayName = "";
      try {
        displayName = Accounts.lookupAccountByCanonicalId(canonicalId).getName();
      } catch (AuthException e) {
        displayName = "";
      }

      Grantee bucketOwner = new Grantee();
      bucketOwner.setCanonicalUser(new CanonicalUser(canonicalId, displayName));
      Grant bucketOwnerGrant = new Grant();
      bucketOwnerGrant.setPermission(ObjectStorageProperties.Permission.READ.toString());
      bucketOwnerGrant.setGrantee(bucketOwner);
      bucketOwnerRead.add(bucketOwnerGrant);
      return bucketOwnerRead;
    }