@@ -0,0 +1,1567 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22Provides a base %60layout class%60_ used to consolidate the api provided%0A  to templates.%0A  %0A  _%60layout classes%60: http://pyramid_layout.readthedocs.org%0A%22%22%22%0A%0A__all__ = %5B%0A    'Layout'%0A%5D%0A%0Aimport logging%0Alogger = logging.getLogger(__name__)%0A%0Afrom pyramid.security import has_permission%0A%0Aclass Layout(object):%0A    %22%22%22A simple base layout api implementation.%22%22%22%0A    %0A    def has_permission(self, permission, context, has_perm=None):%0A        %22%22%22Can the current request (i.e.: the authenticated user if any)%0A          %60%60permission%60%60 the %60%60context%60%60?%0A        %22%22%22%0A        %0A        # Compose.%0A        if has_perm is None:%0A            has_perm = has_permission%0A        %0A        # Return the verdict.%0A        return has_perm(permission, context, self.request)%0A    %0A    def can_admin(self, context, has_perm=None):%0A        return self.has_permission('admin', context)%0A    %0A    def can_create(self, context, has_perm=None):%0A        return self.has_permission('create', context)%0A    %0A    def can_delete(self, context, has_perm=None):%0A        return self.has_permission('delete', context)%0A    %0A    def can_edit(self, context, has_perm=None):%0A        return self.has_permission('edit', context)%0A    %0A    def can_view(self, context, has_perm=None):%0A        return self.has_permission('view', context)%0A    %0A    def __init__(self, context, request):%0A        self.request = request%0A        self.context = request.context%0A        self.registry = request.registry%0A        self.settings = request.registry.settings%0A        self.home_url = request.application_url%0A    %0A%0A

add a base layout module.