diff --git a/gcloud/storage/acl.py b/gcloud/storage/acl.py index a6229cbe5bb7b..3349544f221e1 100644 --- a/gcloud/storage/acl.py +++ b/gcloud/storage/acl.py @@ -19,6 +19,8 @@ corresponds to access for all users. - :func:`ACL.all_authenticated` corresponds to access for all users that are signed into a Google account. + - :func:`ACL.domain` corresponds to access on a + per Google Apps domain (ie, ``example.com``). - :func:`ACL.group` corresponds to access on a per group basis (either by ID or e-mail address). - :func:`ACL.user` corresponds to access on a @@ -92,6 +94,7 @@ def __init__(self, type, identifier=None): is optional. """ + # TODO: Add validation of types. self.identifier = identifier self.roles = set([]) self.type = type @@ -309,6 +312,18 @@ def group(self, identifier): return self.entity('group', identifier=identifier) + def domain(self, domain): + """Factory method for a domain Entity. + + :type domain: string + :param domain: The domain for this entity. + + :rtype: :class:`ACL.Entity` + :returns: An entity corresponding to this domain. + """ + + return self.entity('domain', identifier=domain) + def all(self): """Factory method for an Entity representing all users.