fixed install of permission users_register

This commit is contained in:
Tim Gröger 2021-01-22 14:20:25 +01:00
parent bdbb2d3e45
commit fee4765898
1 changed files with 13 additions and 2 deletions

View File

@ -25,7 +25,15 @@ _permission_register = "users_register"
class UsersPlugin(Plugin):
def __init__(self, cfg):
super().__init__(blueprint=users_bp, permissions=[_permission_edit, _permission_delete, _permission_set_roles])
super().__init__(
blueprint=users_bp,
permissions=[
_permission_edit,
_permission_delete,
_permission_set_roles,
_permission_register,
],
)
@users_bp.route("/users", methods=["POST"])
@ -114,7 +122,10 @@ def get_avatar(userid):
@login_required()
def set_avatar(userid, current_session):
user = userController.get_user(userid)
if userid != current_session._user.userid and not current_session._user.has_permission(_permission_edit):
if (
userid != current_session._user.userid
and not current_session._user.has_permission(_permission_edit)
):
raise Forbidden
file = request.files.get("file")