feat(avatar): complete authorization management

This commit is contained in:
stefanfeng
2026-08-19 16:21:19 +08:00
parent 25d2494616
commit 2e2adeb9e2
10 changed files with 2106 additions and 614 deletions
@@ -27,6 +27,9 @@ def mock_auth():
auth.takeover_delay_seconds = 30
auth.avatar_id = "avatar_123"
auth.target_id = "target_user_123"
auth.target_type = "user"
auth.status = "active"
auth.permissions = ["chat", "takeover"]
return auth
@@ -83,6 +86,7 @@ def test_check_takeover_enabled_returns_none_when_disabled(mock_db, mock_boxim,
disabled_auth = MagicMock(spec=Authorization)
disabled_auth.takeover_enabled = False
disabled_auth.permissions = []
auth_filter = MagicMock()
auth_filter.filter.return_value = auth_filter
auth_filter.first.return_value = disabled_auth