def delete(id): """ Delete a stream. Deletes all permission documents associated with the stream as well. Parameters: id - a stream id. """ db = core.connect() permIds = [perm["_id"] for perm in permission.permissionsForStream(id)] [permission.delete(permId) for permId in permIds] del db[id]
def deleteAllPermissions(): permIds = [aperm["_id"] for aperm in core.query(schema.allPermissions)] [permission.delete(permId) for permId in permIds]
def deleteAllShifts(): shiftIds = [ashift["_id"] for ashift in core.query(schema.allShifts)] [permission.delete(shiftId) for shiftId in shiftIds]