/gdata/acl/data.py

http://radioappz.googlecode.com/ · Python · 55 lines · 18 code · 17 blank · 20 comment · 0 complexity · f952f65c8e54eeb18abb07edea02136c MD5 · raw file

  1. #!/usr/bin/python
  2. #
  3. # Copyright (C) 2009 Google Inc.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. """Contains the data classes of the Google Access Control List (ACL) Extension"""
  17. __author__ = 'j.s@google.com (Jeff Scudder)'
  18. import atom.core
  19. import atom.data
  20. import gdata.data
  21. import gdata.opensearch.data
  22. GACL_TEMPLATE = '{http://schemas.google.com/acl/2007}%s'
  23. class AclRole(atom.core.XmlElement):
  24. """Describes the role of an entry in an access control list."""
  25. _qname = GACL_TEMPLATE % 'role'
  26. value = 'value'
  27. class AclScope(atom.core.XmlElement):
  28. """Describes the scope of an entry in an access control list."""
  29. _qname = GACL_TEMPLATE % 'scope'
  30. type = 'type'
  31. value = 'value'
  32. class AclEntry(gdata.data.GDEntry):
  33. """Describes an entry in a feed of an access control list (ACL)."""
  34. scope = AclScope
  35. role = AclRole
  36. class AclFeed(gdata.data.GDFeed):
  37. """Describes a feed of an access control list (ACL)."""
  38. entry = [AclEntry]