[Plugin] roles: New permission needed for deleting roles

This commit is contained in:
Ferdinand Thiessen 2020-11-16 14:21:19 +01:00
parent 09c7f4a258
commit 39a259a693
1 changed files with 3 additions and 2 deletions

View File

@ -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/<int:role_id>", methods=["DELETE"])
@login_required(permission=_permission_edit)
@login_required(permission=_permission_delete)
def delete_role(role_id, current_session):
"""Delete role