User specific content

A few months ago there was a discussion about how to create dialogs in DB2. And in that we said that when the incoming message is received the socketId must be checked to make sure the dialog is only snown to the user to initiated it (e.g. click on the button to display the dialog).

  watch: {
      msg: function(){
          // only show the dialog if msg.payload is an object and the socket id in the message
          // matches our socket id (which means the popup was initiated from this session) or
          // there is no _client property present which indicates it should be shown on all sessions.
          if (!this.msg._client || this.msg._client.socketId === this.$socket.id) {   
.            // only show the dialog now
            this.dialog = true;
          }

          // prevent redraw on deploy
          this.msg.payload = null;
      }
  },

Now, if I have a page where I want different data to be shown for each user, I could use the same method to match the socket IDs. But that means that for every screen element (button, input, etc). I would need to use a template node so I can include the same client side validation.
I cannot use the regular ui-button, ui-text-input etc as it would update on every single client every time any of the users action cause it to update.
Is this correct?
So with this workaround I can make the dashboard multi user?

So with this workaround I can make the dashboard multi user?

No need, hold off for about a week - and I'll be publishing a blog with more detail on this.

In actual fact, I have already released the functionality in the latest version, but I haven't written too much blog content about it just yet to support it.

I have published some new docs for it though: Building Multi-Tenant Dashboards | Node-RED Dashboard 2.0

2 Likes

Oh Wow, and wow. Lot's of new stuff, very interesting.

I just started putting some basic user authentication together that would allow me to restrict access to specific page on the DB2. A bit of hacky approach, but appears to be working just fine as long as you are not too serious about it and don't look under the hood.
But this plugin thing looks very promising. After the first read of the example, it looks a bit over my head, but I will check again once more documentation is made available.

If you don't forget, please leave some links here as and when they are made available.

Yeah, that documentation literally went live about 10 minutes before your post, so does need some refining, and a simpler "Simple" example too

2 Likes

Hi @joepavitt, in the article above there was a link to a Plugin Data Provider example. Was that moved somewhere else?

Not that I'm aware of? The docs for plugin data providers is: Building Multi-Tenant Dashboards | Node-RED Dashboard 2.0 if that helps?

Article is published: Multi-Tenancy available for everyone with FlowFuse's Dashboard 2.0 • FlowFuse

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.