mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 12:46:35 +00:00
Only show advanced mode toggle for admins. Fixes #3369
This commit is contained in:
parent
09a19d2e7f
commit
3ebb30bd48
@ -104,10 +104,12 @@ class HaPanelProfile extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
mfa-modules="[[hass.user.mfa_modules]]"
|
mfa-modules="[[hass.user.mfa_modules]]"
|
||||||
></ha-mfa-modules-card>
|
></ha-mfa-modules-card>
|
||||||
|
|
||||||
<ha-advanced-mode-card
|
<template is="dom-if" if="[[_isAdmin(hass.user)]]">
|
||||||
hass="[[hass]]"
|
<ha-advanced-mode-card
|
||||||
core-user-data="[[_coreUserData]]"
|
hass="[[hass]]"
|
||||||
></ha-advanced-mode-card>
|
core-user-data="[[_coreUserData]]"
|
||||||
|
></ha-advanced-mode-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
<ha-refresh-tokens-card
|
<ha-refresh-tokens-card
|
||||||
hass="[[hass]]"
|
hass="[[hass]]"
|
||||||
@ -168,6 +170,10 @@ class HaPanelProfile extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
(cred) => cred.auth_provider_type === "homeassistant"
|
(cred) => cred.auth_provider_type === "homeassistant"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_isAdmin(user) {
|
||||||
|
return user.is_admin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("ha-panel-profile", HaPanelProfile);
|
customElements.define("ha-panel-profile", HaPanelProfile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user