Rights needed for update uservariables

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
pigloox
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

Post by pigloox »

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?
RPI3 Stretch (Hard disk)
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
pigloox
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

Post by pigloox »

no one knows how to update a variable without having the full rights ?
RPI3 Stretch (Hard disk)
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
pigloox
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

Post by pigloox »

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
RPI3 Stretch (Hard disk)
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB
User avatar
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

Post by waaren »

pigloox wrote: Saturday 20 April 2019 13:33 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?
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
			}
So yes it is by design; but if you define the IP address of the caller in [setup] [settings] [system] Local Networks (no username/password):
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest