Hi,
I need to update a uservariable via the Json API for a user who has limited rights. How can I do that?
During my tests, I could do it only with a user with "admin" rights is this normal?
Rights needed for update uservariables
Moderators: leecollings, remb0
-
- Posts: 22
- Joined: Tuesday 09 February 2016 23:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: France
- Contact:
Rights needed for update uservariables
RPI3 Stretch (Hard disk)
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
-
- Posts: 22
- Joined: Tuesday 09 February 2016 23:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: France
- Contact:
Re: Rights needed for update uservariables
no one knows how to update a variable without having the full rights ?
RPI3 Stretch (Hard disk)
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
-
- Posts: 22
- Joined: Tuesday 09 February 2016 23:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: France
- Contact:
Re: Rights needed for update uservariables
Hello,
After more than a year with this problem, I would have liked to know if it had been considered a feature to update a variable via json for a non-admin user?
Thx
After more than a year with this problem, I would have liked to know if it had been considered a feature to update a variable via json for a non-admin user?
Thx
RPI3 Stretch (Hard disk)
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Rights needed for update uservariables
Looking at the source code (WebServer.cpp line 1922-)
Code: Select all
void CWebServer::Cmd_UpdateUserVariable(WebEmSession & session, const request& req, Json::Value &root)
{
if (session.rights != 2)
{
session.reply_status = reply::forbidden;
return; //Only admin user allowed
}
you can update the uservariable.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest