view data/plugin/security/bbb_access_data.snippet @ 618:e6a6740166c8

FormCreate: pep8 cleanup
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Mar 2013 16:34:37 +0100
parents fa6bb1f3c86c
children 127da830be6c
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - SecurityPolicy implementing limitation for bbb_create parser

    you have to copy this snippet below your Config definition in 
    or you add it to the main security folder and import it into your Config definition.

    @copyright: 2012 MoinMoin:ReimarBauer
    @license: GNU GPL, see COPYING for details.

from MoinMoin.Page import Page
from import Permissions

class SecurityPolicy(Permissions):
    def read(self, page_name):
        request = self.request
        page = Page(request, page_name)
        format = page.pi['format']
        if format == "bbb_create":
            if request.user.valid and request.action == u"show" or request.user.may.write(page_name):
                return True
            return False
        return Permissions.__getattr__(self, 'read')(page_name)