mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Refactor User attribute caching to be safer and more efficient (#96723)
* Cache construction of is_admin This has to be checked for a lot of api calls and the websocket every time the call is made * Cache construction of is_admin This has to be checked for a lot of api calls and the websocket every time the call is made * Cache construction of is_admin This has to be checked for a lot of api calls and the websocket every time the call is made * modernize * coverage * coverage * verify caching * verify caching * fix type * fix mocking
This commit is contained in:
@@ -669,7 +669,7 @@ class MockUser(auth_models.User):
|
||||
|
||||
def mock_policy(self, policy):
|
||||
"""Mock a policy for a user."""
|
||||
self._permissions = auth_permissions.PolicyPermissions(policy, self.perm_lookup)
|
||||
self.permissions = auth_permissions.PolicyPermissions(policy, self.perm_lookup)
|
||||
|
||||
|
||||
async def register_auth_provider(
|
||||
|
||||
Reference in New Issue
Block a user