本文整理汇总了Python中Products.CMFCore.PortalFolder.PortalFolderBase.manage_delObjects方法的典型用法代码示例。如果您正苦于以下问题:Python PortalFolderBase.manage_delObjects方法的具体用法?Python PortalFolderBase.manage_delObjects怎么用?Python PortalFolderBase.manage_delObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.CMFCore.PortalFolder.PortalFolderBase
的用法示例。
在下文中一共展示了PortalFolderBase.manage_delObjects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: manage_delObjects
# 需要导入模块: from Products.CMFCore.PortalFolder import PortalFolderBase [as 别名]
# 或者: from Products.CMFCore.PortalFolder.PortalFolderBase import manage_delObjects [as 别名]
def manage_delObjects(self, ids=[], REQUEST=None):
"""We need to enforce security."""
if isinstance(ids, basestring):
ids = [ids]
for id in ids:
item = self._getOb(id)
if not _checkPermission(permissions.DeleteObjects, item):
raise Unauthorized, (
"Do not have permissions to remove this object")
return PortalFolder.manage_delObjects(self, ids, REQUEST=REQUEST)
示例2: manage_delObjects
# 需要导入模块: from Products.CMFCore.PortalFolder import PortalFolderBase [as 别名]
# 或者: from Products.CMFCore.PortalFolder.PortalFolderBase import manage_delObjects [as 别名]
def manage_delObjects(self, ids=[], REQUEST=None):
"""We need to enforce security."""
mt = getToolByName(self, 'portal_membership')
if type(ids) is StringType:
ids = [ids]
for id in ids:
item = self._getOb(id)
if not mt.checkPermission(Permissions.delete_objects, item):
raise Unauthorized, (
"Do not have permissions to remove this object")
return PortalFolderBase.manage_delObjects(self, ids, REQUEST=REQUEST)
示例3: manage_delObjects
# 需要导入模块: from Products.CMFCore.PortalFolder import PortalFolderBase [as 别名]
# 或者: from Products.CMFCore.PortalFolder.PortalFolderBase import manage_delObjects [as 别名]
def manage_delObjects(self, ids=None, REQUEST=None):
"""We need to enforce security."""
sm = getSecurityManager()
if not sm.checkPermission('Delete objects', self):
raise Unauthorized(
"Do not have permissions to remove this object")
if ids is None:
ids = []
if isinstance(ids, basestring):
ids = [ids]
for id_ in ids:
item = self._getOb(id_)
if not sm.checkPermission("Delete portal content", item):
raise Unauthorized(
"Do not have permissions to remove this object")
return PortalFolder.manage_delObjects(self, ids, REQUEST=REQUEST)
示例4: manage_delObjects
# 需要导入模块: from Products.CMFCore.PortalFolder import PortalFolderBase [as 别名]
# 或者: from Products.CMFCore.PortalFolder.PortalFolderBase import manage_delObjects [as 别名]
def manage_delObjects(self, ids=None, REQUEST=None):
"""We need to enforce security."""
protect_del_objects(self, ids)
return PortalFolder.manage_delObjects(self, ids, REQUEST=REQUEST)