Allow checking entity permissions based on devices (#19007)
* Allow checking entity permissions based on devices * Fix tests
This commit is contained in:
parent
2680bf8a61
commit
3928d034a3
11 changed files with 143 additions and 27 deletions
|
@ -384,6 +384,7 @@ class MockUser(auth_models.User):
|
|||
'name': name,
|
||||
'system_generated': system_generated,
|
||||
'groups': groups or [],
|
||||
'perm_lookup': None,
|
||||
}
|
||||
if id is not None:
|
||||
kwargs['id'] = id
|
||||
|
@ -401,7 +402,8 @@ class MockUser(auth_models.User):
|
|||
|
||||
def mock_policy(self, policy):
|
||||
"""Mock a policy for a user."""
|
||||
self._permissions = auth_permissions.PolicyPermissions(policy)
|
||||
self._permissions = auth_permissions.PolicyPermissions(
|
||||
policy, self.perm_lookup)
|
||||
|
||||
|
||||
async def register_auth_provider(hass, config):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue