mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
allow web commands only for admin
This commit is contained in:
@@ -317,6 +317,7 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
|
|||||||
renderDeviceData() {
|
renderDeviceData() {
|
||||||
const { deviceData } = this.state;
|
const { deviceData } = this.state;
|
||||||
const { width } = this.props;
|
const { width } = this.props;
|
||||||
|
const me = this.props.authenticatedContext.me;
|
||||||
|
|
||||||
if (this.noDevices()) {
|
if (this.noDevices()) {
|
||||||
return;
|
return;
|
||||||
@@ -350,7 +351,7 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
|
|||||||
return (
|
return (
|
||||||
<TableRow hover key={i}>
|
<TableRow hover key={i}>
|
||||||
<TableCell padding="checkbox" style={{ width: 18 }} >
|
<TableCell padding="checkbox" style={{ width: 18 }} >
|
||||||
{deviceData.data[i + 3] && (
|
{deviceData.data[i + 3] && me.admin && (
|
||||||
<IconButton edge="start" size="small" aria-label="Edit"
|
<IconButton edge="start" size="small" aria-label="Edit"
|
||||||
onClick={() => this.sendCommand(i)}>
|
onClick={() => this.sendCommand(i)}>
|
||||||
<EditIcon fontSize="small" />
|
<EditIcon fontSize="small" />
|
||||||
|
|||||||
Reference in New Issue
Block a user