avoid override of sensitive fields
This commit is contained in:
parent
1eb8e9d076
commit
85913d2c9e
1 changed files with 5 additions and 1 deletions
|
@ -905,8 +905,12 @@ class UsersHandler(CollectionHandler):
|
|||
raise InputException('not authorized to change password')
|
||||
data['password'] = utils.hash_password(new_pwd)
|
||||
if '_id' in data:
|
||||
# Avoid overriding _id
|
||||
del data['_id']
|
||||
if 'username' in data:
|
||||
del data['username']
|
||||
# for the moment, prevent the ability to update permissions via web
|
||||
if 'permissions' in data:
|
||||
del data['permissions']
|
||||
return data
|
||||
|
||||
@gen.coroutine
|
||||
|
|
Loading…
Reference in a new issue