Mark Phillips wrote:
You are correct - I have found that to be a great way to find the API for different tasks, especially when coupled with the DocFinder tab.

However, that solution only adds the role to the acl_users area, and not the security tab. In order to add a role in Plone 2.5, one has to add the role in two places - the acl_users and the Security tab. take a look at http://plone.org/documentation/faq/adding-role/?searchterm=add%20a%20role.

This is why the GenericSetup approach is nice :)

I go the acl_users part to work (see below). My original question was reagarding the Security tab in the ZMI. How do I replicate the Add Role funtion in my Install.py script? I can't seem to find a reference in the DocFinder tab for that section.

I have not specifically tried this on Plone 2.5, but I just found this bit in some two-year-old code I have laying around:

    portal=getToolByName(self,'portal_url').getPortalObject()
    roles=list(portal.__ac_roles__)
    for role in ('CustomRole1','CustomRole2',):
        if role not in roles:
            roles.append(role)
    portal.__ac_roles__=tuple(roles)

Don't really know if it will work for you, but I guess it's worth a shot :)

--
Sean


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to