congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AccessControlList.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.jclouds.s3.domain.AccessControlList
constructor

Best Java code snippets using org.jclouds.s3.domain.AccessControlList.<init> (Showing top 7 results out of 315)

origin: org.jclouds.api/s3

/**
* Converts a canned access control policy into the equivalent access control list.
* 
* @param cannedAP
* @param ownerId
*/
public static AccessControlList fromCannedAccessPolicy(CannedAccessPolicy cannedAP, String ownerId) {
 AccessControlList acl = new AccessControlList();
 acl.setOwner(new CanonicalUser(ownerId));
 // Canned access policies always allow full control to the owner.
 acl.addPermission(new CanonicalUserGrantee(ownerId), Permission.FULL_CONTROL);
 if (CannedAccessPolicy.PRIVATE == cannedAP) {
   // No more work to do.
 } else if (CannedAccessPolicy.AUTHENTICATED_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.AUTHENTICATED_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ_WRITE == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.WRITE);
 }
 return acl;
}
origin: jclouds/legacy-jclouds

/**
* Converts a canned access control policy into the equivalent access control list.
* 
* @param cannedAP
* @param ownerId
*/
public static AccessControlList fromCannedAccessPolicy(CannedAccessPolicy cannedAP, String ownerId) {
 AccessControlList acl = new AccessControlList();
 acl.setOwner(new CanonicalUser(ownerId));
 // Canned access policies always allow full control to the owner.
 acl.addPermission(new CanonicalUserGrantee(ownerId), Permission.FULL_CONTROL);
 if (CannedAccessPolicy.PRIVATE == cannedAP) {
   // No more work to do.
 } else if (CannedAccessPolicy.AUTHENTICATED_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.AUTHENTICATED_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ_WRITE == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.WRITE);
 }
 return acl;
}
origin: Nextdoor/bender

/**
* Converts a canned access control policy into the equivalent access control list.
* 
* @param cannedAP
* @param ownerId
*/
public static AccessControlList fromCannedAccessPolicy(CannedAccessPolicy cannedAP, String ownerId) {
 AccessControlList acl = new AccessControlList();
 acl.setOwner(new CanonicalUser(ownerId));
 // Canned access policies always allow full control to the owner.
 acl.addPermission(new CanonicalUserGrantee(ownerId), Permission.FULL_CONTROL);
 if (CannedAccessPolicy.PRIVATE == cannedAP) {
   // No more work to do.
 } else if (CannedAccessPolicy.AUTHENTICATED_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.AUTHENTICATED_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ_WRITE == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.WRITE);
 }
 return acl;
}
origin: org.apache.jclouds.api/s3

/**
* Converts a canned access control policy into the equivalent access control list.
* 
* @param cannedAP
* @param ownerId
*/
public static AccessControlList fromCannedAccessPolicy(CannedAccessPolicy cannedAP, String ownerId) {
 AccessControlList acl = new AccessControlList();
 acl.setOwner(new CanonicalUser(ownerId));
 // Canned access policies always allow full control to the owner.
 acl.addPermission(new CanonicalUserGrantee(ownerId), Permission.FULL_CONTROL);
 if (CannedAccessPolicy.PRIVATE == cannedAP) {
   // No more work to do.
 } else if (CannedAccessPolicy.AUTHENTICATED_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.AUTHENTICATED_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ_WRITE == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.WRITE);
 }
 return acl;
}
origin: apache/jclouds

/**
* Converts a canned access control policy into the equivalent access control list.
* 
* @param cannedAP
* @param ownerId
*/
public static AccessControlList fromCannedAccessPolicy(CannedAccessPolicy cannedAP, String ownerId) {
 AccessControlList acl = new AccessControlList();
 acl.setOwner(new CanonicalUser(ownerId));
 // Canned access policies always allow full control to the owner.
 acl.addPermission(new CanonicalUserGrantee(ownerId), Permission.FULL_CONTROL);
 if (CannedAccessPolicy.PRIVATE == cannedAP) {
   // No more work to do.
 } else if (CannedAccessPolicy.AUTHENTICATED_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.AUTHENTICATED_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
 } else if (CannedAccessPolicy.PUBLIC_READ_WRITE == cannedAP) {
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.READ);
   acl.addPermission(GroupGranteeURI.ALL_USERS, Permission.WRITE);
 }
 return acl;
}
origin: jclouds/legacy-jclouds

 public void run() {
   try {
    BucketLogging newLogging = getApi().getBucketLogging(bucketName);
    assert newLogging !=null;
    AccessControlList acl = new AccessControlList();
    for (Grant grant : newLogging.getTargetGrants()) { // TODO: add permission
      // checking features to
      // bucketlogging
      acl.addPermission(grant.getGrantee(), grant.getPermission());
    }
    // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by
    // email addr
    assertTrue(acl.hasPermission(StubS3AsyncClient.TEST_ACL_ID, Permission.FULL_CONTROL), acl.toString());
    assertEquals(logging.getTargetBucket(), newLogging.getTargetBucket());
    assertEquals(logging.getTargetPrefix(), newLogging.getTargetPrefix());
   } catch (Exception e) {
    Throwables.propagateIfPossible(e);
   }
 }
});
origin: apache/jclouds

 public void run() {
   try {
    BucketLogging newLogging = getApi().getBucketLogging(bucketName);
    assert newLogging != null;
    AccessControlList acl = new AccessControlList();
    for (Grant grant : newLogging.getTargetGrants()) { // TODO: add permission
      // checking features to
      // bucketlogging
      acl.addPermission(grant.getGrantee(), grant.getPermission());
    }
    // EmailAddressGrantee is replaced by a CanonicalUserGrantee, so we cannot test by
    // email addr
    assertTrue(acl.hasPermission(TEST_ACL_ID, FULL_CONTROL), acl.toString());
    assertEquals(logging.getTargetBucket(), newLogging.getTargetBucket());
    assertEquals(logging.getTargetPrefix(), newLogging.getTargetPrefix());
   } catch (Exception e) {
    Throwables.propagateIfPossible(e);
   }
 }
});
org.jclouds.s3.domainAccessControlList<init>

Popular methods of AccessControlList

  • hasPermission
  • addPermission
    Add a permission for the given grantee.
  • getGrants
  • getOwner
  • getPermissions
  • toString
  • findGrantsForGrantee
    Find all the grants for a given grantee, identified by an ID which allows all Grantee types to be se
  • revokePermission
    Revoke a permission for the given grantee, if this specific permission was granted. Note that you mu
  • setOwner
  • fromCannedAccessPolicy
    Converts a canned access control policy into the equivalent access control list.
  • revokeAllPermissions
    Revoke all the permissions granted to the given grantee.
  • revokeAllPermissions

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now