Mercurial > libervia-backend
changeset 2926:4cd7545c4ebb
core (memory): raise PermissionError directly instead of using failureFailure, as it could not be catched correctly in every case.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 28 Apr 2019 08:55:13 +0200 |
parents | 03a09e16bf28 |
children | 69e4716d6268 |
files | sat/memory/memory.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/memory/memory.py Sun Apr 28 08:55:07 2019 +0200 +++ b/sat/memory/memory.py Sun Apr 28 08:55:13 2019 +0200 @@ -1233,18 +1233,18 @@ perm_data = file_data[u"access"][perm] perm_type = perm_data[u"type"] except KeyError: - raise failure.Failure(exceptions.PermissionError()) + raise exceptions.PermissionError() if perm_type == C.ACCESS_TYPE_PUBLIC: continue elif perm_type == C.ACCESS_TYPE_WHITELIST: try: jids = perm_data[u"jids"] except KeyError: - raise failure.Failure(exceptions.PermissionError()) + raise exceptions.PermissionError() if peer_jid.full() in jids: continue else: - raise failure.Failure(exceptions.PermissionError()) + raise exceptions.PermissionError() else: raise exceptions.InternalError( _(u"unknown access type: {type}").format(type=perm_type) @@ -1530,7 +1530,7 @@ ) def fileUpdate(self, file_id, column, update_cb): - """update a file column taking care of race condition + """Update a file column taking care of race condition access is NOT checked in this method, it must be checked beforehand @param file_id(unicode): id of the file to update