当前位置: 首页>>代码示例>>Python>>正文


Python ATFolder.manage_permission方法代码示例

本文整理汇总了Python中Products.ATContentTypes.content.folder.ATFolder.manage_permission方法的典型用法代码示例。如果您正苦于以下问题:Python ATFolder.manage_permission方法的具体用法?Python ATFolder.manage_permission怎么用?Python ATFolder.manage_permission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products.ATContentTypes.content.folder.ATFolder的用法示例。


在下文中一共展示了ATFolder.manage_permission方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from Products.ATContentTypes.content.folder import ATFolder [as 别名]
# 或者: from Products.ATContentTypes.content.folder.ATFolder import manage_permission [as 别名]
    def setUp(self):
        self.portal = self.layer["portal"]
        pps = self.portal.restrictedTraverse("@@plone_portal_state")
        member = pps.member()
        memberid = member.getId()
        folder = ATFolder(memberid)
        transactions = self.portal.transactions
        transactions._setObject(memberid, folder)
        transactions.reindexObject()
        # Finally, change its permissions
        folder.manage_permission(ModifyPortalContent, roles=[], acquire=0)
        # Make sure the user's service registration dates are correct
        properties = {
            "askanexpert_registrationdate": NULLDATE,
            "answerdatabase_registrationdate": NULLDATE,
            "moreexercise_registrationdate": NULLDATE,
        }
        member.setProperties(properties)

        self.context = self.portal.maths
        self.context.allowQuestions = True
        self.request = self.portal.REQUEST
        self.manager_name = "plone.belowcontent"
        self.themelayer = IEmasThemeLayer

        self.viewlet_name = None
        self.formsubmit_token = None
        self.formfield = None
        self.memberproperty = None
        self.creditproperty = ""
开发者ID:Siyavula,项目名称:emas.theme,代码行数:32,代码来源:test_payservice_viewlets.py

示例2: setSite

# 需要导入模块: from Products.ATContentTypes.content.folder import ATFolder [as 别名]
# 或者: from Products.ATContentTypes.content.folder.ATFolder import manage_permission [as 别名]
if not app.hasObject(portal_id):
    print "Please specify the id of your plone site as the first argument "
    print "to this script."
    print "Usage: <instancehome>/bin/instance run %s <id>" % sys.argv[0]
    sys.exit(1)

portal = app[portal_id]
setSite(portal)

# we assume there is an admin user
app = makerequest.makerequest(app)
user = app.acl_users.getUser('admin')
newSecurityManager(None, user.__of__(app.acl_users))

for member in portal.portal_membership.listMembers():

    transactions = portal.transactions

    memberid = member.getId()

    if not memberid in transactions.objectIds():
        folder = ATFolder(memberid)
        transactions._setObject(memberid, folder)
        transactions.reindexObject()
        folder.manage_permission(ModifyPortalContent, roles=[], acquire=0)
        print "creating folder for ", memberid


transaction.commit()
开发者ID:Siyavula,项目名称:emas.theme,代码行数:31,代码来源:create_transaction_folders.py


注:本文中的Products.ATContentTypes.content.folder.ATFolder.manage_permission方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。