用python 代码给 Plone增加角色 用python 代码给 Plone增加角色 http://www.315ok.org/blogfolder/586 http://www.315ok.org/logo.png 用python 代码给 Plone增加角色 用python 代码给 Plone增加角色 文本 portal._addRole(new_role) try: acl_users.portal_role_manager.addRole(new_role) except: pass参考链接:http://repositorio.interlegis.gov.br/ILSAAP/trunk/InstallUtils/installers/installRoles.py应用例子:https://github.com/simahawk/collective.blueprint.usersandgroups/blob/master/collective/blueprint/usersandgroups/blueprint.py#L62 方法二:## Roles are store on __ac_roles__ attribute of object. roles = list(portal.__ac_roles__) roles += 'yournewrole' portal.__ac_roles__ = tuple(roles) 设置 内容目录 否