Correct permissions test

This commit is contained in:
Léo 2020-11-07 23:36:42 +01:00
parent 11406080ab
commit 5b1b8cb614

4
fs.py
View File

@ -305,7 +305,7 @@ def editfile(id):
f = File.query.get(id) f = File.query.get(id)
if f is None: if f is None:
return flask.redirect(URL_DEFAULT) return flask.redirect(URL_DEFAULT)
if f.user != user and user.is_admin<levels_users['Admin']: if f.user != user.login and user.is_admin<levels_users['Admin']:
return flask.redirect(URL_DEFAULT) return flask.redirect(URL_DEFAULT)
if flask.request.method == "POST": if flask.request.method == "POST":
@ -330,7 +330,7 @@ def delfile(id):
f = File.query.get(id) f = File.query.get(id)
if f is None: if f is None:
return flask.redirect(URL_DEFAULT) return flask.redirect(URL_DEFAULT)
if f.user != user and user.is_admin<levels_users['Admin']: if f.user != user.login and user.is_admin<levels_users['Admin']:
return flask.redirect(URL_DEFAULT) return flask.redirect(URL_DEFAULT)
confirm = flask.request.args.get('confirm') confirm = flask.request.args.get('confirm')