Remove not needed admin checks (#23259)

This commit is contained in:
Wendelin 2024-12-11 16:50:35 +01:00 committed by GitHub
parent 0582b8430d
commit e5e168803a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 10 deletions

View File

@ -140,9 +140,7 @@ export class HuiDialogSelectDashboard extends LitElement {
mode: this.hass.panels.lovelace?.config?.mode,
},
...(this._params!.dashboards || (await fetchDashboards(this.hass))),
].filter(
(dashboard) => this.hass.user!.is_admin || !dashboard.require_admin
);
];
const currentPath = this._fromUrlPath || this.hass.defaultPanel;
for (const dashboard of this._dashboards!) {

View File

@ -90,18 +90,15 @@ export class HuiDialogSelectView extends LitElement {
>
Default
</mwc-list-item>
${this._dashboards.map((dashboard) => {
if (!this.hass.user!.is_admin && dashboard.require_admin) {
return "";
}
return html`
${this._dashboards.map(
(dashboard) => html`
<mwc-list-item
.disabled=${dashboard.mode !== "storage"}
.value=${dashboard.url_path}
>${dashboard.title}</mwc-list-item
>
`;
})}
`
)}
</ha-select>`
: ""}
${!this._config || (this._config.views || []).length < 1