public class AccessControlList
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.HashSet<GrantAndPermission> |
grants |
protected StorageOwner |
owner |
static AccessControlList |
REST_CANNED_AUTHENTICATED_READ
A pre-canned REST ACL to set an object's permissions to Authenticated Read (authenticated Amazon
users can read, only owner can write)
|
static AccessControlList |
REST_CANNED_PRIVATE
A pre-canned REST ACL to set an object's permissions to Private (only owner can read/write)
|
static AccessControlList |
REST_CANNED_PUBLIC_READ
A pre-canned REST ACL to set an object's permissions to Public Read (anyone can read, only owner
can write)
|
static AccessControlList |
REST_CANNED_PUBLIC_READ_WRITE
A pre-canned REST ACL to set an object's permissions to Public Read and Write (anyone can
read/write)
|
Constructor and Description |
---|
AccessControlList() |
Modifier and Type | Method and Description |
---|---|
GrantAndPermission[] |
getGrantAndPermissions() |
java.util.List<GranteeInterface> |
getGranteesWithPermission(Permission permission) |
StorageOwner |
getOwner() |
java.util.List<Permission> |
getPermissionsForGrantee(GranteeInterface grantee) |
java.lang.String |
getValueForRESTHeaderACL() |
void |
grantAllPermissions(GrantAndPermission[] grantAndPermissions)
Adds a set of grantee/permission pairs to the ACL, where each item in the set is a
GrantAndPermission object. |
void |
grantPermission(GranteeInterface grantee,
Permission permission)
Adds a grantee to the ACL with the given permission.
|
boolean |
hasGranteeAndPermission(GranteeInterface grantee,
Permission permission) |
boolean |
isCannedRestACL()
Deprecated.
0.8.0
|
boolean |
isRESTHeaderACL() |
void |
revokeAllPermissions(GranteeInterface grantee)
Revokes the permissions of a grantee by removing the grantee from the ACL.
|
void |
setOwner(StorageOwner owner) |
java.lang.String |
toString()
Returns a string representation of the ACL contents, useful for debugging.
|
java.lang.String |
toXml() |
com.jamesmurty.utils.XMLBuilder |
toXMLBuilder() |
public static final AccessControlList REST_CANNED_PRIVATE
public static final AccessControlList REST_CANNED_PUBLIC_READ
public static final AccessControlList REST_CANNED_PUBLIC_READ_WRITE
public static final AccessControlList REST_CANNED_AUTHENTICATED_READ
protected final java.util.HashSet<GrantAndPermission> grants
protected StorageOwner owner
public java.lang.String toString()
toString
in class java.lang.Object
public StorageOwner getOwner()
public void setOwner(StorageOwner owner)
public java.util.List<Permission> getPermissionsForGrantee(GranteeInterface grantee)
grantee
- the grantee to whom the permission will applypublic java.util.List<GranteeInterface> getGranteesWithPermission(Permission permission)
permission
- Permissionpublic boolean hasGranteeAndPermission(GranteeInterface grantee, Permission permission)
grantee
- the grantee to whom the permission will applypermission
- the permission to apply to the grantee.public void grantPermission(GranteeInterface grantee, Permission permission)
grantee
- the grantee to whom the permission will applypermission
- the permission to apply to the grantee.public void grantAllPermissions(GrantAndPermission[] grantAndPermissions)
GrantAndPermission
object.grantAndPermissions
- the grant and permission combinations to add.public void revokeAllPermissions(GranteeInterface grantee)
grantee
- the grantee to remove from this ACL.public GrantAndPermission[] getGrantAndPermissions()
public com.jamesmurty.utils.XMLBuilder toXMLBuilder() throws ServiceException, javax.xml.parsers.ParserConfigurationException, javax.xml.parsers.FactoryConfigurationError, javax.xml.transform.TransformerException
ServiceException
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.FactoryConfigurationError
javax.xml.transform.TransformerException
public java.lang.String toXml() throws ServiceException
ServiceException
@Deprecated public boolean isCannedRestACL()
public boolean isRESTHeaderACL()
public java.lang.String getValueForRESTHeaderACL()