Scada-LTS icon indicating copy to clipboard operation
Scada-LTS copied to clipboard

Fixed permissions for script execution

Open Limraj opened this issue 3 years ago • 0 comments

Description Although the user does not have set permission for the point, when invoking the script from a view, he can modify its value.

To Reproduce

  1. Create datasource ds_1 (virtual)

  2. Create datapoint dp_to_read (settable, no change, numeric)

  3. Create datapoint dp_to_set (settable, random, numeric, xid: DP_TO_SET)

  4. Go to 'Scripts', and create script sc_1 with : a) Add dp_to_read in "Context points" and set var name var_dp_to_read; b) Check "Datapoints commands" and set name val; c) In text field "Script" set: "val.writeDataPoint('DP_TO_SET', var_dp_to_read.value);"; d) Check script by click "Run" -> if "Executed successfully" is ok;

  5. Go to 'Graphphical Views' and create graphical view gv_1: a) Select "Button (script)" in "Components:" and click "Add component to view" as cmp_to_setting b) Find cmp_to_setting, click "Edit static content", set script sc_1, and click save on component; c) Select "Simple point" in "Components:" and click "Add component to view" as cmp_to_reading d) Find cmp_to_reading, click "Edit static content", select point dp_to_set, and click save on component; e) Select "Simple point" in "Components:" and click "Add component to view" as cmp_current_value f) Find cmp_current_value, click "Edit static content", select point dp_to_read, and click save on component; g) Click save on view;

  6. Go to 'Users' and create user usr_1;

  7. Go to "Users profiles" and create profile prof_1 with read permission for dp_to_set, set for dp_to_read and set or read for gv_1 and save;

  8. Login on usr_1 and go to "Graphical views", set value in cmp_current_value, click on cmp_to_setting -> see change on cmp_to_reading -> error;

Similarly, you need to check anonymous access, you can use the lead from the scenario above, and perform additional steps:

  1. For the user anonymous-user set the profile prof_1;
  2. In the gv_1 view set Anonymous access: set;
  3. Logout and go: http://localhost:8080/ScadaBR/public_view.htm?viewId={viewId}

Specification

  • Scada version 2.6.10

Limraj avatar Nov 26 '21 10:11 Limraj