Forum Academy Marketplace Showcase Pricing Features

What is the best method for two user roles?

I am creating a website with two different roles. They will have profiles that have completely different information.

Option A: Use the prepackaged “User” table in the database. Add Role field, and then add all of the fields for BOTH profiles.
Option B: Use the prepackaged “User” table to get basic user info, Add Role field, then create a new table for each type of role.

It seems like Option B would be a better way to go, but I don’t want to start down a rabbit hole and have something broken later on down the road. Are there other options?

@morgant6911 - For what its worth, this is how I did it (Note: still in development, not published):

My index page is a login screen, the User Tyoe in the database I created a text field in called User Type. In the workflow on the login screen, after the workflows for login, I created a custom event for each of my user types.

Name the even whatever you want > Type of thing = User > and When = "Current Users Type is “whatever type you declare the users as” > and then in the action ribbon on the bottom I navigate the user to a page designed in particular to them. So in my case Admins go to an Admin Dashboard and Employees go to an Employee Dashboard.

My idea is to control the users navigation - then if there is a “shared” page, perhaps use (what I think you are saying as) your Option A, which is to hide/show certain groups/fields depending on the user type.

Not sure about the security, I imagine any user could access any page if they had the URL of other users page.

Anyway, hope it helps - good luck.

I vote Option B.

Example if you have Students and Teachers as roles. Students have GPA, HomeRoom, Parents etc…
Teachers have Salary, Education, Number of Students etc… They are completely different so need to have different tables for each role. However, there should be a key - userid# I think that links the User table to each defined Role Table.

1 Like