How can I login to several companies with one user?

Submitted by Anonymous (not verified) on

I manage several companies on LedgerSMB, can I login to any of these companies with one user?
Applies to LedgerSMB 1.3.x -->
V. 0.1 - 22. Nov 2011

I have 100 companies though on my system and decide to change my password, wouldn't I have to change it a 100 times (one for each company)? What would be the best approach to setting up a user that could be used on several companies (databases)?

In LedgerSMB all your users are database users in PostgreSQL. All PostgreSQL users do not have access to login with LedgerSMB on each company database(s). LedgerSMB has to give access to each user as an LedgerSMB application user, even if the user have PostgreSQL superuser rights on the database level.

You can add the Postgresql user to be a LedgerSMB application user when you make an new database or after the database is created. If you import the account into all the other databases, the password management is consistent cross the databases. However, you are not guaranteed the same permissions on all databases. You could have one set on one database and another set on another.

Fast route: User get "Manage Users" or "Full Permissons" access to LedgerSMB
Use setup.pl to create company database number 1 with ledgersmbdbadm user.
Add a normal application user in the proses ("Enter User" screen) example: your_100_db_user_name

Use setup.pl to create company database number 2, 3, 4... with ledgersmbadm user (or a special admin user for each db).
Import the normal application user you made in database 1 ("Enter User" screen in setup.pl)
Username: your_100_db_user_name
Password: Do not set a password. Leave it blank
Import : Yes
Fill inn first name, last name and select Country and assign permissions.

You can also add the user to the db later:
System->Admin Users->Add Users
Username: your_100_db_user_name
Password: Only set a password in the firstdb. Leave it blank in db 2, 3, 4..
Import : Yes
Fill inn first name, last name and select Contry and assign permissions.

If you add the users later you have the opions to add only the permissions the user needs to do a spesific task.

Technical solution:
From LedgeSMB use this user to setup the database you create a databaseuser with Superuser priviliges.
CREATE USER ledgersmbdbadm WITH superuser password 'somepassword';

Create a normal user
CREATE USER your_100_db_user_name WITH password 'somepassword';
(normal user with no drop db rights)

When you create the db:
Use setup.pl to make the company database(es). Use the ledgersmbdbadm user to login to create the company database (first screen) and add a new user on the ("Enter User" screen)
Username: your_100_db_user_name
Password: Do not set a password. Leave it blank
Import : Yes
Fill inn first name, last name and select Contry and assign permissions.

You can add the user to the db later:
System->Admin Users->Add Users
Username: your_100_db_user_name
Password: Do not set a password. Leave it blank
Import : Yes
Fill inn first name, last name and select Contry and assign permissions.

If you add the users later you have the opions to add only the permissions the user needs to do a spesific task.

Direct login to correct company, take a look at this:
/faq/can-ledgersmbloginpl-take-arguments

Compiled from this e-mail treads:
http://permalink.gmane.org/gmane.comp.finance.ledger.smb.user/5334
http://permalink.gmane.org/gmane.comp.finance.ledger.smb.user/5356
Question from: Steven Marshall
Answer from Håvard Sørli and Chris Travers

 
Release
FAQ Category