Changed permission for deleting,

This commit is contained in:
Ben Arc
2021-04-21 16:00:11 +01:00
parent 39561efe38
commit 71a6d90283
2 changed files with 6 additions and 3 deletions

View File

@@ -155,12 +155,15 @@
><span class="text-blue">GET</span>
/api/v1/copilot/ws/&lt;copilot_id&gt;/&lt;comment&gt;/&lt;data&gt;</code
>
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
<code>{"X-Api-Key": &lt;admin_key&gt;}</code><br />
<h5 class="text-caption q-mt-sm q-mb-none">Returns 200</h5>
<code></code>
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
<code
>curl -X GET {{ request.url_root }}/api/v1/copilot/ws/&lt;string,
copilot_id&gt;/&lt;string, comment&gt;/&lt;string, gif name&gt;
copilot_id&gt;/&lt;string, comment&gt;/&lt;string, gif name&gt; -H
"X-Api-Key: {{ g.user.wallets[0].adminkey }}"
</code>
</q-card-section>
</q-card>

View File

@@ -82,7 +82,7 @@ async def api_copilot_retrieve(copilot_id):
@copilot_ext.route("/api/v1/copilot/<copilot_id>", methods=["DELETE"])
@api_check_wallet_key("invoice")
@api_check_wallet_key("admin")
async def api_copilot_delete(copilot_id):
copilot = await get_copilot(copilot_id)
@@ -95,11 +95,11 @@ async def api_copilot_delete(copilot_id):
@copilot_ext.route("/api/v1/copilot/ws/<copilot_id>/<comment>/<data>", methods=["GET"])
@api_check_wallet_key("admin")
async def api_copilot_ws_relay(copilot_id, comment, data):
copilot = await get_copilot(copilot_id)
if not copilot:
return jsonify({"message": "copilot does not exist"}), HTTPStatus.NOT_FOUND
await updater(data, comment, copilot_id)
print(comment)
return "", HTTPStatus.OK