[Product-Developers] Re: semi n00b-question: how to enable vanilla users the right to add stuff tomy custom folder?

Per Erik Strandberg per.strandberg at incf.org
Wed Feb 20 14:47:49 UTC 2008


Raphael Ritz wrote:
> Per Erik Strandberg wrote:
> [..]
>
> [interesting to see us starting to communicate via this channel
> as well ;-)]
> 

:)

> [..]
>>
>> When I try the sharing tab it does not work. I am deeply annoyed that 
>> there is a sharing tab when it has no or only limited effect :(
>>
> 
> briefly browsing over the code you've posted at the link below
> it seems like you are missing to declare the add permission in
> the call to 'contentInit' in your products '__init__.py'.
> 
> [...]
> 

Ok, indeed that seems to do it. Thanks.

I also changed the allowed_content_types to a tuple ('SimpleThing', ) 
instead of a string ('SimpleThing') [as hinted by Gilles Lenfant].

The __init__.py file now looks pretty much like this:

# ...
from Products.CMFCore.permissions import AddPortalContent

# ...

def initialize(context):
     # ...
     for atype, constructor in allTypes:
         kind = "%s: %s" % (PROJECTNAME, atype.portal_type)
         utils.ContentInit(# ...
                           permission         = AddPortalContent,
                           # ...
                           ).initialize(context)

I've completed the tutorial now - but it turned out to be a lot less 
sexy than I had expected :)
http://www.pererikstrandberg.se/blog/index.cgi?page=PloneSimpleFolderAndPermissions


/P

-- 
Per Erik Strandberg, M.Sc, M.Sc
System Developer

International Neuroinformatics Coordinating Facility
Secretariat
Karolinska Institutet
Nobels väg 15A
SE-171 77 Stockholm
Sweden





More information about the Product-Developers mailing list