mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +00:00
Hide zone edit button for non admins (#4840)
This commit is contained in:
parent
c5aa000a97
commit
0b8700f725
@ -35,7 +35,7 @@ class HaPanelMap extends LocalizeMixin(PolymerElement) {
|
|||||||
<app-toolbar>
|
<app-toolbar>
|
||||||
<ha-menu-button hass="[[hass]]" narrow="[[narrow]]"></ha-menu-button>
|
<ha-menu-button hass="[[hass]]" narrow="[[narrow]]"></ha-menu-button>
|
||||||
<div main-title>[[localize('panel.map')]]</div>
|
<div main-title>[[localize('panel.map')]]</div>
|
||||||
<template is="dom-if" if="[[!computeDemo()]]">
|
<template is="dom-if" if="[[computeShowEditZone(hass)]]">
|
||||||
<paper-icon-button
|
<paper-icon-button
|
||||||
icon="hass:pencil"
|
icon="hass:pencil"
|
||||||
on-click="openZonesEditor"
|
on-click="openZonesEditor"
|
||||||
@ -75,8 +75,8 @@ class HaPanelMap extends LocalizeMixin(PolymerElement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
computeDemo() {
|
computeShowEditZone(hass) {
|
||||||
return __DEMO__;
|
return !__DEMO__ && hass.user.is_admin;
|
||||||
}
|
}
|
||||||
|
|
||||||
openZonesEditor() {
|
openZonesEditor() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user