1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
258 'read': ('managers',), |
258 'read': ('managers',), |
259 'update': ('managers',), |
259 'update': ('managers',), |
260 }) |
260 }) |
261 |
261 |
262 |
262 |
|
263 ENTITY_MANAGERS_PERMISSIONS = { |
|
264 'read': ('managers',), |
|
265 'add': ('managers',), |
|
266 'update': ('managers',), |
|
267 'delete': ('managers',), |
|
268 } |
|
269 RELATION_MANAGERS_PERMISSIONS = { |
|
270 'read': ('managers',), |
|
271 'add': ('managers',), |
|
272 'delete': ('managers',), |
|
273 } |
|
274 |
263 class CWSourceHostConfig(EntityType): |
275 class CWSourceHostConfig(EntityType): |
264 __permissions__ = { |
276 __permissions__ = ENTITY_MANAGERS_PERMISSIONS |
265 'read': ('managers',), |
|
266 'add': ('managers',), |
|
267 'update': ('managers',), |
|
268 'delete': ('managers',), |
|
269 } |
|
270 __unique_together__ = [('match_host', 'cw_host_config_of')] |
277 __unique_together__ = [('match_host', 'cw_host_config_of')] |
271 match_host = String(required=True, maxsize=128, |
278 match_host = String(required=True, maxsize=128, |
272 description=_('regexp matching host(s) to which this config applies')) |
279 description=_('regexp matching host(s) to which this config applies')) |
273 config = String(required=True, |
280 config = String(required=True, |
274 description=_('Source\'s configuration for a particular host. ' |
281 description=_('Source\'s configuration for a particular host. ' |