# Developer teams working in only one project

**URL:** <https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171>\
**Category:** General\
**Created:** [23 January 2019 15:02 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171 "2019-01-23T15:02:04Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [23 January 2019 15:02 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/1 "2019-01-23T15:02:04Z")

</div>

Is it possible to work with more than one user logged in?  
One development team working without overthrowing the other?

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [23 January 2019 15:05 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/2 "2019-01-23T15:05:24Z")

</div>

If you use projects, you can have multiple people working on their own branches in their own editor, but the flow editor isn't really meant for more than one user simultaneously.

---

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [23 January 2019 15:12 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/3 "2019-01-23T15:12:43Z")

</div>

Ahh I understood, I really wanted to work in flow, unfortunately it is not possible to have a team working in the same flow together

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 January 2019 15:14 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/4 "2019-01-23T15:14:27Z")

</div>

> [@DiegoTelles](#):
>
> Is it possible to work with more than one user logged in?  
> One development team working without overthrowing the other?

Yes. You just have to be careful. When User A deploys changes, all of the other users will be notified and asked to review and merge those changes into their workspace. It isn't the best developer experience, but it's better than the old days when User B wouldn't know User A had updated the flows and would completely overwrite them with their own.

---

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [23 January 2019 15:17 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/5 "2019-01-23T15:17:30Z")

</div>

So Nick, when a user logs in to the previous session is dropped, do you have any documentation that I can solve this problem?

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [23 January 2019 15:18 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/6 "2019-01-23T15:18:12Z")

</div>

I stand corrected. Just tested it out and it looks like deploying in one tab no longer murders my undeployed edits in another. Kick ass! When did you do that?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 January 2019 15:21 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/7 "2019-01-23T15:21:03Z")

</div>

> [@DiegoTelles](#):
>
> So Nick, when a user logs in to the previous session is dropped, do you have any documentation that I can solve this problem?

Sorry, not sure what you mean here. Can you explain a bit more what scenario you are concerned about?

---

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [23 January 2019 15:24 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/8 "2019-01-23T15:24:23Z")

</div>

I have a team with 4 people developers and whenever a user logs in the nodeRED the interface drops allowing only one user logged into the server

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 January 2019 15:55 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/9 "2019-01-23T15:55:36Z")

</div>

That doesn't sound right.... do they share the same user/password or do they each have their own?

---

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [23 January 2019 16:12 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/10 "2019-01-23T16:12:45Z")

</div>

Each one has its own user

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 January 2019 16:37 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/11 "2019-01-23T16:37:44Z")

</div>

I cannot reproduce that behaviour. I have an instance with two different users defined in `adminAuth`. I have two separate browser sessions, each logged in as a different user. They can both interact with the editor and deploy changes.

How have you setup adminAuth for your instance?

---

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [23 January 2019 16:47 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/12 "2019-01-23T16:47:00Z")

</div>

I'm with these settings

```auto
   const Concore = require("concore-sdk-js");
// Conecta no datacore master por padrão;
const APP_ID = process.env.APP_ID || ' ';
const APP_KEY= process.env.APP_KEY || ' ';

if (APP_ID === 'datacoreMaster') {
  console.warn('Login configurado para datacoreMaster');
}

Concore.init('https://api.concore.io/api', APP_ID, APP_KEY);

module.exports = {
   type: "credentials",
   users: function(username) {
      console.log(`Checking ${username}`);
       return new Promise(function(resolve) {
           // Do whatever work is needed to check username is a valid
           // user.
           const { Auth } = Concore.Datacore;
           if (!Auth.isLogged()) {
            resolve(null);
            return;
           }

           const currentUser = Auth.getUser();
           console.log(currentUser);

           let valid = false;

           if (currentUser && currentUser.getAtoms('username') === username) {
            valid = true;
           }

           if (valid) {
               // Resolve with the user object. It must contain
               // properties 'username' and 'permissions'
               var user = { username: username, permissions: "*" };
               console.log(`${user.username} can ${user.permissions}`);
               resolve(user);
           } else {
               // Resolve with null to indicate this user does not exist
               console.log(`${username} does not exist`);
               resolve(null);
           }
       });
   },
   authenticate: function(username,password) {
        console.log(`Loggin in ${username}`);
       return new Promise(function(resolve) {
           const { Auth } = Concore.Datacore;
           let userId;

           Auth.login(username, password)
            .then(res => {
              console.log(`User ${res.getId()} found`);
              userId = res.getId();

              const { MoleculeQuery } = Concore.Datacore;
              const query = new MoleculeQuery('Role');
              query.equalTo('name', 'Administrators');
              return query.first();
            })
            .then(adminGroup => {
              let isAdmin = false;
              const users = adminGroup.getAtoms('users');
              users.forEach(u => {
                if (u.id === userId) {
                  console.log(`User ${username} is ADMIN`);
                  isAdmin = true;
                  var user = { username: username, permissions: "*" };
                  resolve(user);
                  return;
                }
              });

              if (!isAdmin) {
                console.log(`User ${username} is NOT ADMIN`);
                resolve(null);
              }
            })
            .catch(err => {
              console.error(err);
              resolve(null);
            });
       });
   },
   default: function() {
       return new Promise(function(resolve) {
           // Resolve with the user object for the default user.
           // If no default user exists, resolve with null.
           // resolve({anonymous: true, permissions:"read"});
           resolve(null);
       });
   }
}

```

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 January 2019 16:48 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/13 "2019-01-23T16:48:51Z")

</div>

Ah - so you are using a custom auth plugin. Have you debugged why it is logging people out?

---

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [16 May 2019 17:09 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/14 "2019-05-16T17:09:51Z")

</div>

Mr, good afternoon!  
A promise simply drops the authenticated user, does this form of authentication support multiple users?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [16 May 2019 17:20 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/15 "2019-05-16T17:20:45Z")

</div>

> [@DiegoTelles](#):
>
> A promise simply drops the authenticated user, does this form of authentication support multiple users?

Not really sure what you mean. Yes, custom auth plugins support multiple users - they wouldn't be very useful if they didn't.

---

<div class="post-metadata">

**Author:** ![DiegoTelles](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diegotelles/32/5236_2.png) [@DiegoTelles](https://discourse.nodered.org/u/DiegoTelles)\
**Post date:** [16 May 2019 19:09 UTC](https://discourse.nodered.org/t/developer-teams-working-in-only-one-project/7171/16 "2019-05-16T19:09:57Z")

</div>

Problem solved!  
My method was having problems in the validation if, I removed it because it was returning false the new user, thus knocking down the previous user!

Thank you! o/
