Logic Machine Forum
Visualitzation User - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Visualitzation User (/showthread.php?tid=4148)



Visualitzation User - jmir - 14.07.2022

Hi,

Is there any way to create a user that only have visualitzation rights?

It would be useful for example on an office building where users can see all the temperatures, setpoints and status but not allowed to change anything.
The administrator of the building (with its own user) should be the only user allowed to modify this values.

Thanks.


RE: Visualitzation User - fleeceable - 14.07.2022

You can add new user and give him partial access to visualisation. Then in visualisation tab give access rights what pages he can see. And on advanced tab add group addresses what he is allowed to see (only temp group addresses in your case).

But that solution hides all setpoints as well.
   


RE: Visualitzation User - Daniel - 14.07.2022

In JS you can make all element read only and hide all inline elements like this. This will work only in gui
Code:
$(function() {
  if (window.Globals && Globals.user == 'admin') {
    $('.item-control').addClass('item-read-only');
    $('.item-control-single').addClass('hide');
  }
});



RE: Visualitzation User - jmir - 14.07.2022

Thanks for the answers!

I'll try second option because we'd like to see the same information (despite the user) but make it only readable.


RE: Visualitzation User - jmir - 14.07.2022

(14.07.2022, 08:41)Daniel Wrote: In JS you can make all element read only and hide all inline elements like this. This will work only in gui
Code:
$(function() {
  if (window.Globals && Globals.user == 'admin') {
    $('.item-control').addClass('item-read-only');
    $('.item-control-single').addClass('hide');
  }
});

Hi Daniel,

Is there any way to differentiate link buttons from object buttons? I'd like to mantain links between plans active.

Thanks


RE: Visualitzation User - Daniel - 14.07.2022

Try this, Add additional class 'link' to your links 
Code:
$(function() {
  if (window.Globals && Globals.user == 'admin') {
    $('.item-control').addClass('item-read-only');
    $('.item-control-single').addClass('hide');
    $('.link').removeClass('item-read-only');
  }
});



RE: Visualitzation User - jmir - 14.07.2022

(14.07.2022, 10:35)Daniel Wrote: Try this, Add additional class 'link' to your links 
Code:
$(function() {
  if (window.Globals && Globals.user == 'admin') {
    $('.item-control').addClass('item-read-only');
    $('.item-control-single').addClass('hide');
    $('.link').removeClass('item-read-only');
  }
});

Hi, I've tryied and it works.
But in terms of security, is there any more secure way to do it?
Because it's pretty easy to enable it using web browser inspection tools...


RE: Visualitzation User - Ibrahim - 13.04.2023

(14.07.2022, 10:35)Daniel Wrote: Try this, Add additional class 'link' to your links 
Code:
$(function() {
  if (window.Globals && Globals.user == 'admin') {
    $('.item-control').addClass('item-read-only');
    $('.item-control-single').addClass('hide');
    $('.link').removeClass('item-read-only');
  }
});

Hello Daniel,

I have two users whose names are manager and operator. The manager can access all element but the operator not all of them. 

Can we change this code to make read only if the operetor is logged in and a link is added to the additional class?

Thanks.


RE: Visualitzation User - admin - 14.04.2023

If you need to hide certain plans for a user you can simply change access rights. Then a plan link to hidden plans won't be shown at all for this user.


RE: Visualitzation User - Ibrahim - 14.04.2023

Hi,
No, I do not need to hide the plans. I need to make ready only some elements of the plan. For example, on/off is active but setpoint is ready only for the operator.
Thanks.


RE: Visualitzation User - admin - 14.04.2023

This will make all elements with operator-read-only class read-only for operator username.
Code:
$(function() {
  if (window.Globals && Globals.user == 'operator') {
    $('.operator-read-only').addClass('item-read-only');
  }
});



RE: Visualitzation User - Ibrahim - 14.04.2023

Thanks.