System groups (#18303)
* Add read only and admin policies * Migrate to 2 system groups * Add system groups * Add system groups admin & read only * Dont' mutate parameters * Fix types
This commit is contained in:
parent
54b0cde52a
commit
f7f0a4e811
14 changed files with 309 additions and 68 deletions
|
@ -15,6 +15,7 @@ from contextlib import contextmanager
|
|||
from homeassistant import auth, core as ha, config_entries
|
||||
from homeassistant.auth import (
|
||||
models as auth_models, auth_store, providers as auth_providers)
|
||||
from homeassistant.auth.permissions import system_policies
|
||||
from homeassistant.setup import setup_component, async_setup_component
|
||||
from homeassistant.config import async_process_component_config
|
||||
from homeassistant.helpers import (
|
||||
|
@ -349,7 +350,7 @@ class MockGroup(auth_models.Group):
|
|||
"""Mock a group in Home Assistant."""
|
||||
|
||||
def __init__(self, id=None, name='Mock Group',
|
||||
policy=auth_store.DEFAULT_POLICY):
|
||||
policy=system_policies.ADMIN_POLICY):
|
||||
"""Mock a group."""
|
||||
kwargs = {
|
||||
'name': name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue