Ejemplo n.º 1
0
def initialize(ev):
    pconfig = ev.config

    # mount application to '/' location wit custom ApplicationRoot
    factory = ptah.cms.ApplicationFactory(
        PloudApplicationRoot, "/", "root", "Ptah CMS", ApplicationPolicy, default_root=True
    )
    pconfig.set_root_factory(factory)

    # give managers all permissions
    acl = [(Allow, Everyone, ptah.cms.View)]
    for login in PTAH_CONFIG.managers:
        user = User.get(login)
        if user is not None:
            acl.append((Allow, user.uri, ALL_PERMISSIONS))

            # theme gallery
            GALLERY_ACL.allow(user.uri, ALL_PERMISSIONS)

    ApplicationPolicy.__acl__ = acl