1
0
forked from ScoDoc/ScoDoc

Changed route: /role/create/<str:role_name>

This commit is contained in:
Emmanuel Viennet 2022-08-10 07:29:34 +02:00
parent ae2a56cad3
commit 84c08ff225
2 changed files with 3 additions and 3 deletions

View File

@ -306,8 +306,8 @@ def role_permission_remove(role_name: str, perm_name: str):
return jsonify(role.to_dict()) return jsonify(role.to_dict())
@bp.route("/role/<string:role_name>/create", methods=["POST"]) @bp.route("/role/create/<string:role_name>", methods=["POST"])
@api_web_bp.route("/role/<string:role_name>/create", methods=["POST"]) @api_web_bp.route("/role/create/<string:role_name>", methods=["POST"])
@login_required @login_required
@scodoc @scodoc
@permission_required(Permission.ScoSuperAdmin) @permission_required(Permission.ScoSuperAdmin)

View File

@ -105,7 +105,7 @@ def test_roles(api_admin_headers):
uid = user["id"] uid = user["id"]
ans = POST_JSON(f"/user/{uid}/role/Secr/add", headers=admin_h) ans = POST_JSON(f"/user/{uid}/role/Secr/add", headers=admin_h)
assert ans["user_name"] == "test_roles" assert ans["user_name"] == "test_roles"
role = POST_JSON("/role/Test_X/create", headers=admin_h) role = POST_JSON("/role/create/Test_X", headers=admin_h)
assert role["role_name"] == "Test_X" assert role["role_name"] == "Test_X"
assert role["permissions"] == [] assert role["permissions"] == []
role = GET("/role/Test_X", headers=admin_h) role = GET("/role/Test_X", headers=admin_h)