PageRenderTime 22ms CodeModel.GetById 13ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/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
17"""Contains the data classes of the Google Access Control List (ACL) Extension"""
18
19
20__author__ = 'j.s@google.com (Jeff Scudder)'
21
22
23import atom.core
24import atom.data
25import gdata.data
26import gdata.opensearch.data
27
28
29GACL_TEMPLATE = '{http://schemas.google.com/acl/2007}%s'
30
31
32class AclRole(atom.core.XmlElement):
33  """Describes the role of an entry in an access control list."""
34  _qname = GACL_TEMPLATE % 'role'
35  value = 'value'
36
37
38class AclScope(atom.core.XmlElement):
39  """Describes the scope of an entry in an access control list."""
40  _qname = GACL_TEMPLATE % 'scope'
41  type = 'type'
42  value = 'value'
43
44
45class AclEntry(gdata.data.GDEntry):
46  """Describes an entry in a feed of an access control list (ACL)."""
47  scope = AclScope
48  role = AclRole
49
50
51class AclFeed(gdata.data.GDFeed):
52  """Describes a feed of an access control list (ACL)."""
53  entry = [AclEntry]
54
55