Package org.jets3t.service.acl.gs

Examples of org.jets3t.service.acl.gs.UserByIdGrantee


  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);
      return true;
    } catch (ServiceException e) {
      throw new StorageCloudException("AWSS3Exception::" + e.getMessage());
    }
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

           accessControlList.setOwner(owner);
           insideACL = true;
       } else if (name.equals("Scope")) {
           scopeType = attrs.getValue("type");
           if (scopeType.equals("UserById")) {
               currentGrantee = new UserByIdGrantee();
           } else if (scopeType.equals("UserByEmail")) {
               currentGrantee = new UserByEmailAddressGrantee();
           } else if (scopeType.equals("GroupById")) {
               currentGrantee = new GroupByIdGrantee();
           } else if (scopeType.equals("GroupByEmail")) {
View Full Code Here

TOP

Related Classes of org.jets3t.service.acl.gs.UserByIdGrantee

Copyright © 2018 www.massapicom. 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.