Package org.jclouds.s3.domain
Class AccessControlList
java.lang.Object
org.jclouds.s3.domain.AccessControlList
An Access Control List (ACL) describes the access control settings for a bucket or object in S3.
ACL settings comprise a set of
AccessControlList.Grant
s, 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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static final class
static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPermission
(URI groupGranteeURI, String permission) Add a permission for the given group grantee.addPermission
(AccessControlList.Grantee grantee, String permission) Add a permission for the given grantee.boolean
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.static AccessControlList
fromCannedAccessPolicy
(CannedAccessPolicy cannedAP, String ownerId) Converts a canned access control policy into the equivalent access control list.getOwner()
getPermissions
(String granteeId) getPermissions
(URI granteeURI) getPermissions
(AccessControlList.Grantee grantee) int
hashCode()
boolean
hasPermission
(String granteeId, String permission) boolean
hasPermission
(URI granteeURI, String permission) boolean
hasPermission
(AccessControlList.Grantee grantee, String permission) Revoke all the permissions granted to the given grantee.revokePermission
(URI groupGranteeURI, String permission) Revoke a permission for the given group grantee, if this specific permission was granted.revokePermission
(AccessControlList.Grantee grantee, String permission) Revoke a permission for the given grantee, if this specific permission was granted.void
setOwner
(CanonicalUser owner) toString()
-
Constructor Details
-
AccessControlList
public AccessControlList()
-
-
Method Details
-
setOwner
-
getOwner
-
getGrants
- Returns:
- an unmodifiable set of grants represented by this ACL.
-
getGrantees
- Returns:
- an unmodifiable set of grantees who have been assigned permissions in this ACL.
-
addPermission
Add a permission for the given grantee.- Parameters:
grantee
-permission
-
-
addPermission
Add a permission for the given group grantee.- Parameters:
groupGranteeURI
-permission
-
-
revokePermission
Revoke a permission for the given grantee, if this specific permission was granted. Note that you must be very explicit about the permissions you revoke, you cannot revoke partial permissions and expect this class to determine the implied remaining permissions. For example, if you revoke theAccessControlList.Permission.READ
permission from a grantee withAccessControlList.Permission.FULL_CONTROL
access, the revocation will do nothing and the grantee will retain full access. To change the access settings for this grantee, you must first remove theAccessControlList.Permission.FULL_CONTROL
permission the add back theAccessControlList.Permission.READ
permission.- Parameters:
grantee
-permission
-
-
revokePermission
Revoke a permission for the given group grantee, if this specific permission was granted. Note that you must be very explicit about the permissions you revoke, you cannot revoke partial permissions and expect this class to determine the implied remaining permissions. For example, if you revoke theAccessControlList.Permission.READ
permission from a grantee withAccessControlList.Permission.FULL_CONTROL
access, the revocation will do nothing and the grantee will retain full access. To change the access settings for this grantee, you must first remove theAccessControlList.Permission.FULL_CONTROL
permission the add back theAccessControlList.Permission.READ
permission.- Parameters:
groupGranteeURI
-permission
-
-
revokeAllPermissions
Revoke all the permissions granted to the given grantee.- Parameters:
grantee
-
-
getPermissions
- Parameters:
granteeId
-- Returns:
- the permissions assigned to a grantee, as identified by the given ID.
-
getPermissions
- Parameters:
grantee
-- Returns:
- the permissions assigned to a grantee.
-
getPermissions
- Parameters:
granteeURI
-- Returns:
- the permissions assigned to a group grantee.
-
hasPermission
- Parameters:
granteeId
-permission
-- Returns:
- true if the grantee has the given permission.
-
hasPermission
- Parameters:
grantee
-permission
-- Returns:
- true if the grantee has the given permission.
-
hasPermission
- Parameters:
granteeURI
-permission
-- Returns:
- true if the grantee has the given permission.
-
findGrantsForGrantee
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
Converts a canned access control policy into the equivalent access control list.- Parameters:
cannedAP
-ownerId
-
-
toString
-
hashCode
public int hashCode() -
equals
-