Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide zone edit button for non admins #4840

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/panels/map/ha-panel-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HaPanelMap extends LocalizeMixin(PolymerElement) {
<app-toolbar>
<ha-menu-button hass="[[hass]]" narrow="[[narrow]]"></ha-menu-button>
<div main-title>[[localize('panel.map')]]</div>
<template is="dom-if" if="[[!computeDemo()]]">
<template is="dom-if" if="[[computeShowEditZone(hass)]]">
<paper-icon-button
icon="hass:pencil"
on-click="openZonesEditor"
Expand Down Expand Up @@ -75,8 +75,8 @@ class HaPanelMap extends LocalizeMixin(PolymerElement) {
}
}

computeDemo() {
return __DEMO__;
computeShowEditZone(hass) {
return !__DEMO__ && hass.user.is_admin;
}

openZonesEditor() {
Expand Down