def checkPermissionDeleteObjects(self, object_ids): """ Some users need to delete their own items, although they do not have delete permission on parent. Check whether user can delete the sub objects with ids `object_ids` """ if self.checkPermissionDeleteObject(): # user can delete anything inside, if he can delete the container return True objects = [self[object_id] for object_id in object_ids] permissions = [x.checkPermissionDeleteObject() for x in objects] return all(permissions)
def checkPermissionRenameObjects(self, object_ids): """ Check the permissions to rename objects. """ objects = [self[object_id] for object_id in object_ids] permissions = [x.checkPermissionRenameObject() for x in objects] return all(permissions)