Source code for pyams_portal

#
# 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, Resource
library = Library('pyams_portal', 'resources')


pyams_portal_css = Resource(library, 'css/portal.css',
                            minified='css/portal.min.css')

pyams_portal = Resource(library, 'js/portal.js',
                        minified='js/portal.min.js',
                        bottom=True,
                        depends=[pyams_portal_css, ])


from pyramid.i18n import TranslationStringFactory
_ = TranslationStringFactory('pyams_portal')


[docs]def includeme(config): """Pyramid include""" from pyams_content.interfaces import WEBMASTER_ROLE from pyams_portal.interfaces import MANAGE_TEMPLATE_PERMISSION, DESIGNER_ROLE from pyams_security.interfaces import ADMIN_USER_ID, SYSTEM_ADMIN_ROLE from pyams_utils.interfaces import VIEW_PERMISSION, VIEW_SYSTEM_PERMISSION from .include import include_package include_package(config) # register custom permissions config.register_permission({'id': MANAGE_TEMPLATE_PERMISSION, 'title': _("Manage portal templates")}) # register custom roles config.register_role({'id': DESIGNER_ROLE, 'title': _("Portal templates manager"), 'permissions': {MANAGE_TEMPLATE_PERMISSION, VIEW_PERMISSION, VIEW_SYSTEM_PERMISSION}, 'managers': {ADMIN_USER_ID, 'role:{0}'.format(SYSTEM_ADMIN_ROLE), 'role:{0}'.format(WEBMASTER_ROLE)}})