forked from ScoDoc/ScoDoc
Changed route: /role/create/<str:role_name>
This commit is contained in:
parent
ae2a56cad3
commit
84c08ff225
@ -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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user