src/pyams_portal/__init__.py
changeset 0 6f99128c6d48
child 2 619200513bbc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_portal/__init__.py	Wed Jun 17 09:58:33 2015 +0200
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+from fanstatic import Library
+library = Library('pyams_portal', 'resources')
+
+from pyramid.i18n import TranslationStringFactory
+_ = TranslationStringFactory('pyams_portal')
+
+
+def includeme(config):
+    """Pyramid include"""
+
+    from .include import include_package
+    include_package(config)
+
+    # register custom permissions
+    config.register_permission({'id': 'portal.templates.manage',
+                                'title': _("Manage portal templates")})
+
+    # register custom roles
+    config.register_role({'id': 'portal.TemplatesManager',
+                          'title': _("Portal templates manager"),
+                          'permissions': {'portal.templates.manage', 'view', 'system.view'}})