diff --git a/app/views/rest.py b/app/views/rest.py index e920d23..6525790 100644 --- a/app/views/rest.py +++ b/app/views/rest.py @@ -64,8 +64,11 @@ def deleteNode(nodeId: int): @rest_blueprint.route('/node//rename/', methods=['GET']) -@auth.authorize_admins('default') +@auth.access_control('default') def renameNode(nodeId: int, newName: str): + node = Node().get(nodeId) + if not auth.userOrAdmin(node.user.name): + return auth.unathorized Node().rename(nodeId, newName) return jsonify(dict(newName=newName)) diff --git a/pyproject.toml b/pyproject.toml index fc7bf37..ab3b485 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hsman" -version = "0.9.10" +version = "0.9.11" description = "Flask Admin webui for Headscale" authors = ["Andrea Mistrali "] license = "BSD"