Class AccessControlList


  • public class AccessControlList
    extends Object
    An Access Control List (ACL) describes the access control settings for a bucket or object in S3. ACL settings comprise a set of AccessControlList.Grants, each of which specifies a AccessControlList.Permission that has been granted to a specific AccessControlList.Grantee. If an payload tries to access or modify an item in S3, the operation will be denied unless the item has ACL settings that explicitly permit that payload to perform that action.
    • Constructor Detail

      • AccessControlList

        public AccessControlList()
    • Method Detail

      • getGrantees

        public Set<AccessControlList.Grantee> getGrantees()
        Returns:
        an unmodifiable set of grantees who have been assigned permissions in this ACL.
      • addPermission

        public AccessControlList addPermission​(URI groupGranteeURI,
                                               String permission)
        Add a permission for the given group grantee.
        Parameters:
        groupGranteeURI -
        permission -
      • getPermissions

        public Collection<String> getPermissions​(String granteeId)
        Parameters:
        granteeId -
        Returns:
        the permissions assigned to a grantee, as identified by the given ID.
      • getPermissions

        public Collection<String> getPermissions​(URI granteeURI)
        Parameters:
        granteeURI -
        Returns:
        the permissions assigned to a group grantee.
      • hasPermission

        public boolean hasPermission​(String granteeId,
                                     String permission)
        Parameters:
        granteeId -
        permission -
        Returns:
        true if the grantee has the given permission.
      • hasPermission

        public boolean hasPermission​(AccessControlList.Grantee grantee,
                                     String permission)
        Parameters:
        grantee -
        permission -
        Returns:
        true if the grantee has the given permission.
      • hasPermission

        public boolean hasPermission​(URI granteeURI,
                                     String permission)
        Parameters:
        granteeURI -
        permission -
        Returns:
        true if the grantee has the given permission.
      • findGrantsForGrantee

        protected Collection<AccessControlList.Grant> findGrantsForGrantee​(String granteeId)
        Find all the grants for a given grantee, identified by an ID which allows all Grantee types to be searched.
        Parameters:
        granteeId - identifier of a canonical user, email address user, or group.
      • fromCannedAccessPolicy

        public static AccessControlList fromCannedAccessPolicy​(CannedAccessPolicy cannedAP,
                                                               String ownerId)
        Converts a canned access control policy into the equivalent access control list.
        Parameters:
        cannedAP -
        ownerId -
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object