From fee476589871c5374afa6e030ae5be03e9575f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Fri, 22 Jan 2021 14:20:25 +0100 Subject: [PATCH] fixed install of permission users_register --- flaschengeist/plugins/users/__init__.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/flaschengeist/plugins/users/__init__.py b/flaschengeist/plugins/users/__init__.py index f5ed33d..fb04d93 100644 --- a/flaschengeist/plugins/users/__init__.py +++ b/flaschengeist/plugins/users/__init__.py @@ -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")