This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Change the visualization icons to read only (view) if viewer user access
#1
Hello 
Is it possible via script to change the whole visu. to read only, if viewer user access.
regards,
Best Regards,
Reply
#2
Add this code to Custom JavaScript. Keep in mind that this will only block the visualization elements not the actual writing. By default Link elements and Widgets won't work with this solution. As a work-around you can add clickable class to the elements that the user should be able to click.
Code:
$(function() {
  if (Globals.user == 'viewer') {
    $('.layer > div').addClass('item-read-only');
    $('.clickable').removeClass('item-read-only');
  }
});
Reply
#3
(25.11.2021, 09:12)admin Wrote: Add this code to Custom JavaScript. Keep in mind that this will only block the visualization elements not the actual writing. By default Link elements and Widgets won't work with this solution. As a work-around you can add clickable class to the elements that the user should be able to click.
Code:
$(function() {
  if (Globals.user == 'viewer') {
    $('.layer > div').addClass('item-read-only');
    $('.clickable').removeClass('item-read-only');
  }
});

thanks Admin,
Great, work perfect on visu. but could I add clickable class to Alarm link so viewer user can acknowledge alarms?
Also what did you mean by this statement:  "Keep in mind that this will only block the visualization elements not the actual writing."
Best Regards,
Reply
#4
You can add this class to any visualization element that still needs to be clickable. But this solution will only block the UI. The user still can write to objects. For example by opening the browser console and executing grp.write() from there.
There's no solution to fully block writing at the moment. It's only possible to provide a list of objects that the user can read and write in Advanced tab of user properties in User access.
Reply
#5
(25.11.2021, 09:31)admin Wrote: You can add this class to any visualization element that still needs to be clickable. But this solution will only block the UI. The user still can write to objects. For example by opening the browser console and executing grp.write() from there.
There's no solution to fully block writing at the moment. It's only possible to provide a list of objects that the user can read and write in Advanced tab of user properties in User access.

Thanks Allot.
Best Regards,
Reply
#6
Hello Admin
I have a customer that he want to create different users for the employee and each will have access to his office only.
So the JS will check the user name and make the total interface as read only except his office.
Best Regards,
Reply
#7
I see no need for JS here. You can specify plan access rights for each user separately. For improved security you can also provide a group address list that each user has access to.
Reply
#8
(21.02.2022, 08:37)admin Wrote: I see no need for JS here. You can specify plan access rights for each user separately. For improved security you can also provide a group address list that each user has access to.

Thanks Admin
I forgot this feature
BR,
Best Regards,
Reply


Forum Jump: