mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 23:06:40 +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,
|
||||
},
|
||||
...(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!) {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user