本文整理汇总了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 = ""
示例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()