Currently I have the following database design
A user is either a person or a business entity. How do I extend this database design so that under a single business account, a business can allow for multi user access?
Example a business might want to give access their control panel access to an accountant, a developer, etc… A developer should only be able to view and manage applications while an accountant can view / download transactions etc…
USER
Id
Name
Username
Password
...
PERSONAL_INFO
UserId (PK-FK)
FirstName
MiddleName
LastName
....
BUSINESS_INFO
UserId (PK-FK)
BusinessName
....
Would this do it?
USER_ACCESS?
Id
BusinessUserId
GrantedUserId
USER_PERMISSION
Id
UserAccessId
PermissionId
PERMISSION
Id
Name
i think, it’s better to add the entity BUSINESS_INFO and the attribute BusinessInfoId (foreign key to BUSINESS_INFO table) to USER table. The BUSINESS_GROUP table will have the primary key BusinessInfoId (of int type, e.g.)
notice, PERSONAL_INFO table is redundant. its fields must be normalized in USER table