mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Remove not needed admin checks (#23259)
This commit is contained in:
parent
0582b8430d
commit
e5e168803a
@ -140,9 +140,7 @@ export class HuiDialogSelectDashboard extends LitElement {
|
|||||||
mode: this.hass.panels.lovelace?.config?.mode,
|
mode: this.hass.panels.lovelace?.config?.mode,
|
||||||
},
|
},
|
||||||
...(this._params!.dashboards || (await fetchDashboards(this.hass))),
|
...(this._params!.dashboards || (await fetchDashboards(this.hass))),
|
||||||
].filter(
|
];
|
||||||
(dashboard) => this.hass.user!.is_admin || !dashboard.require_admin
|
|
||||||
);
|
|
||||||
|
|
||||||
const currentPath = this._fromUrlPath || this.hass.defaultPanel;
|
const currentPath = this._fromUrlPath || this.hass.defaultPanel;
|
||||||
for (const dashboard of this._dashboards!) {
|
for (const dashboard of this._dashboards!) {
|
||||||
|
@ -90,18 +90,15 @@ export class HuiDialogSelectView extends LitElement {
|
|||||||
>
|
>
|
||||||
Default
|
Default
|
||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
${this._dashboards.map((dashboard) => {
|
${this._dashboards.map(
|
||||||
if (!this.hass.user!.is_admin && dashboard.require_admin) {
|
(dashboard) => html`
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
<mwc-list-item
|
<mwc-list-item
|
||||||
.disabled=${dashboard.mode !== "storage"}
|
.disabled=${dashboard.mode !== "storage"}
|
||||||
.value=${dashboard.url_path}
|
.value=${dashboard.url_path}
|
||||||
>${dashboard.title}</mwc-list-item
|
>${dashboard.title}</mwc-list-item
|
||||||
>
|
>
|
||||||
`;
|
`
|
||||||
})}
|
)}
|
||||||
</ha-select>`
|
</ha-select>`
|
||||||
: ""}
|
: ""}
|
||||||
${!this._config || (this._config.views || []).length < 1
|
${!this._config || (this._config.views || []).length < 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user