So, I’m trying to set up two different user bases (I think that’s what I’m trying to do anyway…). Basically, I want an external company to be able to login in to my app, and be able to add their own users under their company profile etc but the external company and their users still needs to reside in my companies main database. So when the main user (administrator) of the external company logs in, they can add their staff, and when those staff log in, they can only see their profile / user information. But they sit within their external companies profile, and then all of them sit within my main database. I want oversight over them all. I’ve tried playing with permissions and roles but it’s not really working…
This is a pretty simplified explanation, I’d be happy to talk about it in more depth if need be.
By default, all users are stored in the users data table. Regardless of what company, external or internal, they belong to - you’ll want to store their data in that table.
If you haven’t already, I would recommend you create a data table called Companies. You can store both your company and external companies here. From the users table, create 2 connection fields to the companies data table. One field is for the external company connection, the other field is for your company connection.
When a user is created, they will have a connection to both an external company and your company. You can set the connection to your company automatically using something like a table rule or a record rule.
As far as displaying all of this data, there are lots of different ways to do this. Here are a few ideas…
- Create specific admin pages to show users connected to their company.
- Create a specific page for you to show all users who connect to your company, then create a users details page to show users connected to that external company.
- If you intend to do this all from the profile page, you can use User Roles to define the visibility of any row on the page. This means you could place a component displaying users in a row, and only show the row to admins.
Adding filters to the Data Source is a great way to get the functionality that you’re looking for.
I hope this makes sense! Please let me know if you’d like any clarification or if you’d like to discuss further
THANK YOU!!! Absolute legend - it’s working!!! Big smile on my face!
You’re welcome! Happy to hear you’re back to building!
To take this a step further - How would you setup the following: The company admin creates multiple branch locations that contains employee data and needs to add company users with permissions that can ONLY view their respective branch location data? ie STEP 1: The admin creates the branch and assigns employees to the branch STEP 2: the admin then has an ADD USER form whereby they would have a checkbox list of all branches in the company and can select the branch or branches that the user can ONLY manage that branch location employee data. Thanks