Skip to content

Commit

Permalink
Fixed #14 - Added support for domains in ACLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeewax committed Feb 6, 2014
1 parent f81d00d commit 338f0f4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gcloud/storage/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 338f0f4

Please sign in to comment.