Can I use an admin account for multiple companies ?

I have got the white label for my company but my account manager requires to set another company to separate personal accounts from enterprise accounts, I thought I can solve this creating a new company, even thought the system asked me to create a new user for the new “company”, no big deal because I can switch companies/user with the user I have. Unfortunately I cannot assign her user/email to the new company because it is already in use with the first company created.

Is there a way I can reuse the account manager credentials to see/switch between both companies without creating a new user for her?

Since you’re self hosting you could manually add a row to the user_accounts tables linking the two users.

Note: the user would need to log out/in for the changes to take effect.

I went into mysql and tried to find some documentation of the table in the website, but i did not find and example or something to clarify how to use the table.

the table fields are :

+----------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | user_id1 | int(10) unsigned | YES | MUL | NULL | | | user_id2 | int(10) unsigned | YES | MUL | NULL | | | user_id3 | int(10) unsigned | YES | MUL | NULL | | | user_id4 | int(10) unsigned | YES | MUL | NULL | | | user_id5 | int(10) unsigned | YES | MUL | NULL | | +----------+------------------+------+-----+---------+----------------+

I would like to know if I should use normal IDs from the Users table ? Should I create two users? I don’t understand the next steps. thanks.

EDIT: sorry, even I sent you the old database install, I still cannot understand very well how does this works, I will write more about this later, sorry for the mistake

To clarify… none of this is documented, we don’t recommend manually modifying the database. I’m just suggesting the only way I know how to solve your problem.

In order to be able to switch between accounts a row must exist with user ids of the two accounts. You’d want to first create the users in the app and then make sure the row exists to link the users.

@hillel I just do exactly what you said, and it worked perfectly, thank you very much, I will continue recomending this platform and tool. Thank you very much for your help again :slight_smile:

Great to hear, thanks for letting us know!

Hi, is this somehow possible in v5? I set up 3 small companies and want my wife to have access to 2 of them with the top left company Switcher enabled for her. By the way: great stuff you created with invoiceninja :wink:

Ahhh, found the solution here: Adding same User to multiple Companys is throwing error · Issue #4994 · invoiceninja/invoiceninja · GitHub
Since latest update you can add the same user to multiple companies - and the user will be have access to all companies he has an account using the top left company switcher :wink:

1 Like