Package org.jets3t.service.acl.gs

Examples of org.jets3t.service.acl.gs.GSAccessControlList.grantPermission()


  public boolean setAcl(String cid, String id, String permission, String clientId) throws StorageCloudException {

    try {
      GSAccessControlList acl = new GSAccessControlList();
      if(permission.equals("rw"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_FULL_CONTROL);
      else if(permission.equals("r"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_READ);
      else if(permission.equals("w"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_WRITE);
      gsService.putBucketAcl(cid, acl);
View Full Code Here


    try {
      GSAccessControlList acl = new GSAccessControlList();
      if(permission.equals("rw"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_FULL_CONTROL);
      else if(permission.equals("r"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_READ);
      else if(permission.equals("w"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_WRITE);
      gsService.putBucketAcl(cid, acl);
      return true;
    } catch (ServiceException e) {
View Full Code Here

      if(permission.equals("rw"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_FULL_CONTROL);
      else if(permission.equals("r"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_READ);
      else if(permission.equals("w"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_WRITE);
      gsService.putBucketAcl(cid, acl);
      return true;
    } catch (ServiceException e) {
      throw new StorageCloudException("AWSS3Exception::" + e.getMessage());
    }
View Full Code Here

        gsService.createBucket(publicBucketName);

        // Retrieve the bucket's ACL and modify it to grant public access,
        // ie READ access to the ALL_USERS group.
        GSAccessControlList bucketAcl = gsService.getBucketAcl(publicBucketName);
        bucketAcl.grantPermission(new AllUsersGrantee(), Permission.PERMISSION_READ);

        // Update the bucket's ACL. Now anyone can view the list of objects in this bucket.
        publicBucket.setAcl(bucketAcl);
        gsService.putBucketAcl(publicBucket);
View Full Code Here

        // for a fuller discussion of these settings.

        GSAccessControlList acl = new GSAccessControlList();

        // Grant access by email address. Note that this only works email address of GS members.
        acl.grantPermission(new UserByEmailAddressGrantee("someone@somewhere.com"),
            Permission.PERMISSION_FULL_CONTROL);

        // Grant Read access by Goodle ID.
        acl.grantPermission(new UserByIdGrantee("Google member's ID"),
            Permission.PERMISSION_READ);
View Full Code Here

        // Grant access by email address. Note that this only works email address of GS members.
        acl.grantPermission(new UserByEmailAddressGrantee("someone@somewhere.com"),
            Permission.PERMISSION_FULL_CONTROL);

        // Grant Read access by Goodle ID.
        acl.grantPermission(new UserByIdGrantee("Google member's ID"),
            Permission.PERMISSION_READ);

        // Grant Write access to a group by domain.
        acl.grantPermission(new GroupByDomainGrantee("yourdomain.com"),
            Permission.PERMISSION_WRITE);
View Full Code Here

        // Grant Read access by Goodle ID.
        acl.grantPermission(new UserByIdGrantee("Google member's ID"),
            Permission.PERMISSION_READ);

        // Grant Write access to a group by domain.
        acl.grantPermission(new GroupByDomainGrantee("yourdomain.com"),
            Permission.PERMISSION_WRITE);
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.