def storea(self, oid, serial, data, id): try: old_data, old_tid = ServerStorage.loadEx(self, oid) self._check_permissions(old_data, oid) except POSKeyError: pass # We store a new one data += self.user_id return ServerStorage.storea(self, oid, serial, data, id)
def loadBefore(self, oid, tid): r = ServerStorage.loadBefore(self, oid, tid) if r is not None: data, serial, after = r self._check_permissions(data, oid) return data[:-len(self.user_id)], serial, after else: return r
def load(self, oid, version=''): data, tid = ServerStorage.load(self, oid, version) self._check_permissions(data, oid) return data[:-len(self.user_id)], tid
def loadSerial(self, oid, serial): data = ServerStorage.loadSerial(self, oid, serial) self._check_permissions(data, oid) return data[:-len(self.user_id)]