[Plugin] roles: New permission needed for deleting roles
This commit is contained in:
parent
09c7f4a258
commit
39a259a693
|
@ -13,11 +13,12 @@ from flaschengeist.controller import roleController
|
||||||
|
|
||||||
roles_bp = Blueprint("roles", __name__)
|
roles_bp = Blueprint("roles", __name__)
|
||||||
_permission_edit = "roles_edit"
|
_permission_edit = "roles_edit"
|
||||||
|
_permission_delete = "roles_delete"
|
||||||
|
|
||||||
|
|
||||||
class RolesPlugin(Plugin):
|
class RolesPlugin(Plugin):
|
||||||
def __init__(self, config):
|
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"])
|
@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"])
|
@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):
|
def delete_role(role_id, current_session):
|
||||||
"""Delete role
|
"""Delete role
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue