From 39a259a6934872d371432f5b722d2d811f0db6ed Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 16 Nov 2020 14:21:19 +0100 Subject: [PATCH] [Plugin] roles: New permission needed for deleting roles --- flaschengeist/plugins/roles/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flaschengeist/plugins/roles/__init__.py b/flaschengeist/plugins/roles/__init__.py index 15ebe47..fd93a03 100644 --- a/flaschengeist/plugins/roles/__init__.py +++ b/flaschengeist/plugins/roles/__init__.py @@ -13,11 +13,12 @@ from flaschengeist.controller import roleController roles_bp = Blueprint("roles", __name__) _permission_edit = "roles_edit" +_permission_delete = "roles_delete" class RolesPlugin(Plugin): def __init__(self, config): - super().__init__(config, roles_bp, permissions=[_permission_edit]) + super().__init__(config, roles_bp, permissions=[_permission_edit, _permission_delete]) @roles_bp.route("/roles", methods=["GET"]) @@ -123,7 +124,7 @@ def edit_role(role_id, current_session): @roles_bp.route("/roles/", methods=["DELETE"]) -@login_required(permission=_permission_edit) +@login_required(permission=_permission_delete) def delete_role(role_id, current_session): """Delete role