Permissions and watchlist dropdown configuration
-
It seems that when I save a dynamic watchlist default parameter to which the user has access, all available deviceNames correctly populates the drop down list based on user permissions to the points. However, if there is no default parameter saved for the W/L or the user does not have permission to the points which the default parameter queries then the dropdown list returns empty list and does not get populated with the deviceNames to which the user has access which is frustrating . How does one make the watchlist parameter dropdown show only device names based on user point permissions?
-
Hi Phillip,
Thanks for bringing this to our attention. I'm not sure I saw exactly what you're describing. In my tests, if a user had read permission to a point (not from set permission and not from data source permission, but actual read permission) then the device name was appearing in the parameter dropdown of device names. Otherwise, it was not, and the default setting didn't seem to affect anything. I have created this issue about it: https://github.com/infiniteautomation/ma-core-public/issues/1272
-
We have a watchlist with a parameter variable selectedDevice representing a deviceName list selection and it is set to a default value of "device-102". If user102 has read point permissions to points for devices-101 and devices-102 then the watchlist parameter dropdown will contain deviceNames 101 and 102 only. However if user101 loads the same watchlist and has access to only points on device-101 but not device 102 which is the default device for the watchlist then nothing gets loaded into the dropdown where one would like it to populate with device-101. If there is no default deviceName saved for the watchlist parameter then neither user101 nor user102 will have values populated in the dropdown.
-
I see how that could happen. The SQL keyword
DISTINCT
is in the select in that REST controller, so it's only checking the readPermission of the first point with a given deviceName from the dataPoints table. I have corrected this. -
Thank-you, that's awesome Phil , When is the next release date?
-
I went ahead and released an updated API module just now, that's all that changed. Give it a whirl!
-
ok I updated but it did not correct the issue ..When user201 logs in the dropdown is empty because the watchlist default parameter is set to unit202 and user201 does not have permission to unit202 points so the dropdown is empty and no points are selected.
If I clear the parameter and save the watchlist even superadmin gets an empty dropdown list. I used 101 and 102 above but its same situation with 201 and 202. User201 has access to Unit201 points and User202 has access to Unit202 & Unit201. He sees a list because the default device202 has points he has permission to and user201 does not. -
Do you have any errors in your developer tools or in your log output when the list fails to present options?
I am certain that I have tested the situation you're describing, and am not seeing the issue. Perhaps you can email my a zip of your database?
-
Doing it now Phil. might be a bit 2 big. 200m zipped
or I can send you long in details to see it yourself. -
How about just one of the SQL backups?
-
The file was too massive to email so sent you login info
-
Thank you again Phil for the help and I am happy to report all is working perfectly. I removed the default parameter and set the watchlist parameter variable to the user's default device permission using a nested in-line if statement in the <watchlist ng-init . Works perfect :>)
-
Nice! Thanks for sharing how you got it initializing to a good value!
We noticed that after I fixed the rest controller as noted in this thread, that the drop down did have the entries we desired by that the carrot to expand the watchlist wasn't clickable even though there were entries in the select. We clicked the select itself and it populated appropriately.