mxm Content Rules
It does not overrule the permission you set in the portal_types tool. It only limits what content types that appear in the dropdowns.
This approach also has the (dis)advantage that it is not a permission issue. It is entirely an interface tool, for making the site simpler to use for members.
Basic rules
You can "allow" or "deny" content by path and content type. The general syntax is:
RULE COLON PATHS SEMICOLON PORTALTYPES
- RULE is either "allow" or "deny" (case does not matter)
- PATHS is one or more paths relative to the portal. "/" is portal root. "/Members" is the member folder. Paths are seperated by commas.
- PORTALTYPES is either a valid portal_type like "Document" or "Folder", or a wildcard meaning any type.
- A line with a "#" anywhere in it, is a comment. Not only in the beginning.
The default rule is to allow all content anywhere. It looks like:
allow: /; *
If you write nothing in the "content_rules" property, this will be the effective rule. So if you are ever in doubt, just delete all rules, and the site will works af if the tool was not installed.
If you want a site where it is only possible to add Folders and Documents in member folders, you can use these rules:
# first deny all portal types in the member folders
deny: /Members; *
# then allow some types for all members
allow: /Members; Document, Folder
# and also allow news articles and images for the members "maxm" and "bob"
allow: /Members/maxm, /Members/bob; News Item, Image
The rules are checked sequentially.
License:
GPL
Contact:
Download:
Download from the download section here
taking roles in account
inheritance
it's a nice and easy to use tool. Thank you. I was wondering: is there a way to keep a folder from inheriting the rule of its container? I have a folderish type in which I would like the users to be able to add types that they are not allowed to add in the container...
At any rate: great job. Thanks
Once you install, go to the mxm_contentrules_tool. To setup content access rules, on the Properties tab, edit the content_rules property. Let's say you want to only allow Document types to be added to your tps_reports folder. You would setup your content_rules like so:
# first deny all content types to tps_reports
deny: /tps_reports; *
# next allow only Documents in tps_reports
allow: /tps_reports; Document
It works like this because rules are checked sequentially. You first deny all content types to your tps_reports folder. Then, you allow only the Document type in a subsequent rule.
Hope this helps! Thanks, maxm, for a handy product! The other way of accomplishing this in Plone is a pain.
-tjstankus