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]]"
|
||||
></ha-mfa-modules-card>
|
||||
|
||||
<template is="dom-if" if="[[_isAdmin(hass.user)]]">
|
||||
<ha-advanced-mode-card
|
||||
hass="[[hass]]"
|
||||
core-user-data="[[_coreUserData]]"
|
||||
></ha-advanced-mode-card>
|
||||
</template>
|
||||
|
||||
<ha-refresh-tokens-card
|
||||
hass="[[hass]]"
|
||||
@ -168,6 +170,10 @@ class HaPanelProfile extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||
(cred) => cred.auth_provider_type === "homeassistant"
|
||||
);
|
||||
}
|
||||
|
||||
_isAdmin(user) {
|
||||
return user.is_admin;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("ha-panel-profile", HaPanelProfile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user