# HG changeset patch # User Paul Boddie # Date 1383864723 -3600 # Node ID 4f6a13846f8fddff689ac461ca4e30d410762063 # Parent 1fa2c8a69d68d7f7146a267b4b5b8eabab9a7b38 Changed form-specific ACLs, building them on the acl_rights_before setting. Updated the version number and release notes. diff -r 1fa2c8a69d68 -r 4f6a13846f8f MoinForms.py --- a/MoinForms.py Thu Nov 07 23:26:32 2013 +0100 +++ b/MoinForms.py Thu Nov 07 23:52:03 2013 +0100 @@ -21,7 +21,7 @@ except ImportError: from StringIO import StringIO -__version__ = "0.1" +__version__ = "0.2" form_field_regexp_str = r"<>" form_field_regexp = re.compile(form_field_regexp_str, re.DOTALL) @@ -423,6 +423,20 @@ self.request = request self.attributes = attributes + def getAccessACL(self, access): + + """ + Return the form-specific ACL specified by 'access' with the "before" + policy being used as the basis of the resultant policy. + """ + + cfg = self.request.cfg + + # Combine the "before" ACL with the form-specific policy. + + before_acl = [s.split(" ", 1)[1] for s in cfg.cache.acl_rights_before.getString().split("\n") if s.startswith("#acl ")] + return security.AccessControlList(cfg, before_acl + [access]) + def getACL(self): """ @@ -432,7 +446,7 @@ if self.attributes.has_key("access"): access = self.attributes["access"] - return security.AccessControlList(self.request.cfg, [access]) + return self.getAccessACL(access) else: return Page(self.request, self.pagename).getACL(self.request) @@ -489,7 +503,7 @@ if self.attributes.has_key("access"): access = self.attributes["access"] - acl = security.AccessControlList(self.request.cfg, [access]) + acl = self.getAccessACL(access) policy = lambda request, pagename, username, action: acl.may(request, username, action) # Otherwise, use the page permissions. diff -r 1fa2c8a69d68 -r 4f6a13846f8f PKG-INFO --- a/PKG-INFO Thu Nov 07 23:26:32 2013 +0100 +++ b/PKG-INFO Thu Nov 07 23:52:03 2013 +0100 @@ -1,12 +1,12 @@ Metadata-Version: 1.1 Name: MoinForms -Version: 0.1 +Version: 0.2 Author: Paul Boddie Author-email: paul at boddie org uk Maintainer: Paul Boddie Maintainer-email: paul at boddie org uk Home-page: http://moinmo.in/ParserMarket/MoinForms -Download-url: http://moinmo.in/ParserMarket/MoinForms?action=AttachFile&do=view&target=MoinForms-0.1.tar.bz2 +Download-url: http://moinmo.in/ParserMarket/MoinForms?action=AttachFile&do=view&target=MoinForms-0.2.tar.bz2 Summary: Permit the definition of flexible Web forms in wiki pages License: GPL (version 2 or later) Description: The MoinForms extension for MoinMoin provides a way of defining Web diff -r 1fa2c8a69d68 -r 4f6a13846f8f README.txt --- a/README.txt Thu Nov 07 23:26:32 2013 +0100 +++ b/README.txt Thu Nov 07 23:52:03 2013 +0100 @@ -128,5 +128,24 @@ Packages Release Information -------- ------------------- -MoinSupport Tested with 0.4.1 +MoinSupport Tested with 0.5 Source: http://hgweb.boddie.org.uk/MoinSupport + +New in MoinForms 0.2 (Changes since MoinForms 0.1) +-------------------------------------------------- + + * Changed the interpretation of form-specific "access" ACLs, combining them + with the acl_rights_before configuration setting. + * Added support for subpage storage of form data along with a parser to + navigate from such data to a populated form showing such data. + +Release Procedures +------------------ + +Update the MoinForms __version__ attribute and the setup.py version details. +Change the version number and package filename/directory in the documentation. +Update the setup.py and PKG-INFO files. +Update the release notes (see above). +Tag, export. +Archive, upload. +Update the ParserMarket (see above for the URL). diff -r 1fa2c8a69d68 -r 4f6a13846f8f setup.py --- a/setup.py Thu Nov 07 23:26:32 2013 +0100 +++ b/setup.py Thu Nov 07 23:52:03 2013 +0100 @@ -8,6 +8,6 @@ author = "Paul Boddie", author_email = "paul@boddie.org.uk", url = "http://moinmo.in/ParserMarket/MoinForms", - version = "0.1", + version = "0.2", py_modules = ["MoinForms"] )