Examples of grantPermission()


Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

           
            Grantee grantee = grant.getGrantee();
            if (grantee instanceof Group) {
                GroupGrantee jets3tGrantee = new GroupGrantee();
                jets3tGrantee.setIdentifier(((Group)grantee).getURI());               
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof CanonicalUser) {
                CanonicalUser canonicalUser = (CanonicalUser) grantee;
                CanonicalGrantee jets3tGrantee = new CanonicalGrantee();
                jets3tGrantee.setIdentifier(canonicalUser.getID());
                jets3tGrantee.setDisplayName(canonicalUser.getDisplayName());
View Full Code Here

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

            } else if (grantee instanceof CanonicalUser) {
                CanonicalUser canonicalUser = (CanonicalUser) grantee;
                CanonicalGrantee jets3tGrantee = new CanonicalGrantee();
                jets3tGrantee.setIdentifier(canonicalUser.getID());
                jets3tGrantee.setDisplayName(canonicalUser.getDisplayName());
                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof AmazonCustomerByEmail) {
                AmazonCustomerByEmail customerByEmail = (AmazonCustomerByEmail) grantee;
                EmailAddressGrantee jets3tGrantee = new EmailAddressGrantee();
                jets3tGrantee.setIdentifier(customerByEmail.getEmailAddress());
                acl.grantPermission(jets3tGrantee, permission);               
View Full Code Here

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

                acl.grantPermission(jets3tGrantee, permission);               
            } else if (grantee instanceof AmazonCustomerByEmail) {
                AmazonCustomerByEmail customerByEmail = (AmazonCustomerByEmail) grantee;
                EmailAddressGrantee jets3tGrantee = new EmailAddressGrantee();
                jets3tGrantee.setIdentifier(customerByEmail.getEmailAddress());
                acl.grantPermission(jets3tGrantee, permission);               
            } else {
                throw new S3ServiceException("Unrecognised grantee type: " + grantee.getClass());
            }
        }
        return acl;
View Full Code Here

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

              if (log.isWarnEnabled()) {
                  log.warn("Target logging bucket '" + status.getTargetBucketName()
                      + "' does not have the necessary ACL settings, updating ACL now");
              }
             
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_WRITE);
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_READ_ACP);
                putBucketAcl(status.getTargetBucketName(), logBucketACL);
            } else {
              if (log.isDebugEnabled()) {
                  log.debug("Target logging bucket '" + status.getTargetBucketName()
View Full Code Here

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

                  log.warn("Target logging bucket '" + status.getTargetBucketName()
                      + "' does not have the necessary ACL settings, updating ACL now");
              }
             
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_WRITE);
                logBucketACL.grantPermission(GroupGrantee.LOG_DELIVERY, Permission.PERMISSION_READ_ACP);
                putBucketAcl(status.getTargetBucketName(), logBucketACL);
            } else {
              if (log.isDebugEnabled()) {
                  log.debug("Target logging bucket '" + status.getTargetBucketName()
                      + "' has the necessary ACL settings");
View Full Code Here

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

        s3Service.createBucket(publicBucket);
       
        // Retrieve the bucket's ACL and modify it to grant public access,
        // ie READ access to the ALL_USERS group.
        AccessControlList bucketAcl = s3Service.getBucketAcl(publicBucket);
        bucketAcl.grantPermission(GroupGrantee.ALL_USERS, Permission.PERMISSION_READ);
       
        // Update the bucket's ACL. Now anyone can view the list of objects in this bucket.
        publicBucket.setAcl(bucketAcl);
        s3Service.putBucketAcl(publicBucket);
        System.out.println("View bucket's object listing here: http://s3.amazonaws.com/"
View Full Code Here

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

        // for a fuller discussion of these settings.
       
        AccessControlList acl = new AccessControlList();
       
        // Grant access by email address. Note that this only works email address of AWS S3 members.
        acl.grantPermission(new EmailAddressGrantee("someone@somewhere.com"),
            Permission.PERMISSION_FULL_CONTROL);
       
        // Grant control of ACL settings to a known AWS S3 member.
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_READ_ACP);
View Full Code Here

Examples of org.jets3t.service.acl.AccessControlList.grantPermission()

        // Grant access by email address. Note that this only works email address of AWS S3 members.
        acl.grantPermission(new EmailAddressGrantee("someone@somewhere.com"),
            Permission.PERMISSION_FULL_CONTROL);
       
        // Grant control of ACL settings to a known AWS S3 member.
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_READ_ACP);
        acl.grantPermission(new CanonicalGrantee("AWS member's ID"),
            Permission.PERMISSION_WRITE_ACP);
       
    
View Full Code Here

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

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

    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
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.