Introduce only_supervisor for @websocket_api.ws_require_user() (#61298)

This commit is contained in:
Stefan Agner 2021-12-09 01:49:35 +01:00 committed by GitHub
parent 1f1a29cada
commit a13ae85982
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 13 deletions

View file

@ -113,7 +113,7 @@ def ws_info(
connection.send_result(msg["id"], recorder_info)
@websocket_api.require_admin
@websocket_api.ws_require_user(only_supervisor=True)
@websocket_api.websocket_command({vol.Required("type"): "backup/start"})
@websocket_api.async_response
async def ws_backup_start(
@ -131,7 +131,7 @@ async def ws_backup_start(
connection.send_result(msg["id"])
@websocket_api.require_admin
@websocket_api.ws_require_user(only_supervisor=True)
@websocket_api.websocket_command({vol.Required("type"): "backup/end"})
@websocket_api.async_response
async def ws_backup_end(