Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Isolating users to a dashboard with only their device points


  • Can someone explain how I can set up our system so a user logs in and goes to their home dashboard which loads the data from the device associated with this userid? Right now whatever value was saved in the watchlist gets loaded on init and I would like to load the user specific data on init. Can someone show me how this is done in code?


  • I think you are talking about a custom dashboard attached to a watchlist with parameters? Each user is directed to the same dashboard but you want to set the parameters differently depending on which user views the page?


  • yes exactly.. how is this accomplished?


  • There are several different approaches.

    Are you using <ma-watch-list-parameters> to display a drop down? Or do you want the parameter fixed depending on the user, and not selectable?

    Does the watchlist only have a single parameter which is a device name?


  • yes the watchlist query has a parameter for the device name and the users are all named similar to the device names so I was hoping to query the device matching a substring of the {{user.username}} to the device name? Example User U2501 would access devicename = "Unit 2501" so I need to build this expression out of the user.username and I am not certain how to include the user.username in the query to get it this substring into the expression.


  • now we are using the dropdown list and we will keep this as a separate dashboard for admins but for the regular users redirected to a specific dashboard we won't keep the dropdown so the parameter would also work...

    Point hierarchy folder ID = "Unit " + {{user.username.substr(1,4)}}

    OR

    or(eq(deviceName,{{user.username.substr(1,4)}}),eq(deviceName,Outside%20Climate))&sort(deviceName,name)&limit(200)


  • Interesting, this is pretty much exactly what I would like to do, except that my device names/points aren't tied to a user, I would just like to be able to associate a user with a specific point and allow them to only see that one point.

    Did you guys ever figure this out? Is there a way I can associate some tag with a user account which would allow me to display only the data which I want them to see?


  • @psysak said in Isolating users to a dashboard with only their device points:

    I would just like to be able to associate a user with a specific point and allow them to only see that one point.

    If you set the point permissions so they only have read access to that one point then that is the only point that will be returned in point queries for that user.


  • This may be of some interest as well. Like Jared mentioned, setting read permissions now will influence what a user can pull esp. in RQL queries.
    I've gone as far as tagging all of my points. Setting a 'user' tag to match the same name as the usernames. That way when I pull a page of a certain system 'type' all data associated with that user is pulled as well. Am still working on making a linking system with users has n devices and each device has these points etc...


  • @jared-wiltshire said in Isolating users to a dashboard with only their device points:

    @psysak said in Isolating users to a dashboard with only their device points:

    I would just like to be able to associate a user with a specific point and allow them to only see that one point.

    If you set the point permissions so they only have read access to that one point then that is the only point that will be returned in point queries for that user.

    Oh that's a nice and simple solution :)

    @mattfox said in Isolating users to a dashboard with only their device points:

    This may of some interest as well. Like Jared mentioned, setting read permissions now will influence what a user can pull esp. in RQL queries.
    I've gone as far as tagging all of my points. Setting a 'user' tag to match the same name as the usernames. That way when I pull a page of a certain system 'type' all data associated with that user is pulled as well. Am still working on making a linking system with users has n devices and each device has these points etc...

    I was just goofing around with that myself but I seem to be too inept to figure out how then to query for that tag :(


  • in(tags.user,username)&limit(100)&sort(name)
    OR
    like(tags.user,*user*)&limit(100)&sort(name)

    The RQL query watchlist builder is your friend here.

    EDIT: Do note I created my own tags, and my own page to handle them. You'd have to use the bulk datapoint editor to set tags I believe.


  • I do agree that you should tag your data points as well as setting the permission on them. Will make it easier for you as an admin to distinguish between them.

    @mattfox said in Isolating users to a dashboard with only their device points:

    You'd have to use the bulk datapoint editor to set tags I believe.

    Correct, or the CSV import, or JSON configuration import. There is a new Data Sources page coming in the next major UI release, so it will become easier!


  • @mattfox said in Isolating users to a dashboard with only their device points:

    in(tags.user,username)&limit(100)&sort(name)
    OR
    like(tags.user,*user*)&limit(100)&sort(name)

    The RQL query watchlist builder is your friend here.

    EDIT: Do note I created my own tags, and my own page to handle them. You'd have to use the bulk datapoint editor to set tags I believe.

    First of all that worked beautifully, thank you :)

    I had a question about the username portion of the query. So I set a custom tag to my username, call it user1. If I run that query and actually just type user1 I get my point list. If however I try to pass something like {{user.current.username}} it never matches. I even have a block of code on my page which is just a span <span> Your username is {{user.current.username}} and that shows "user1". I'm missing something fundamental.


  • You'll likely need to do this:
    <ma-point-query query="'in(tags.username,'+user.current.username+')&sort(deviceName)&limit(200)'" points="userPoints">/<ma-point-query>


  • Works like a charm, just user has to be User, picky little thing :)