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:
Paulus Schoutsen 2018-11-08 12:57:00 +01:00 committed by GitHub
parent 54b0cde52a
commit f7f0a4e811
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 309 additions and 68 deletions

View file

@ -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,