Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 518895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:59:03+00:00 2026-05-13T07:59:03+00:00

I have a problem I am trying to solve as smooth as possible, and

  • 0

I have a problem I am trying to solve as smooth as possible, and also keep it as safe and flexible as possible!

I have a web app where I have 2 kinds of users; Back end users (trusted users; Admins!), and Customers (Front end users; not trusted in the same way)! They do work on some of the same data in the database, but the Customers can only do a subset of what the Back end users can do (like Salesforce users and customers “Self Service Portal”)!

I also want to have 2 separate tables in the database for the back end users and the customers (tables are named User and Customer, and they both have a username and password row)…

Should I implement this with 2 different authentication methods, or should I use one authentication method and use roles instead (Then I would skip having 2 tables I the database with username and password, and let all use the User table)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:59:04+00:00Added an answer on May 13, 2026 at 7:59 am

    The following database structure would allow for scaling if you find that you need to eventually maintain multiple roles for users (which happens alot from my experience).

    CREATE TABLE user (
       id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
       name VARCHAR(120),
       created_ts DATETIME DEFAULT '0000-00-00 00:00:00'
    );
    
    CREATE TABLE user_role (
      id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
      user_id INT(11) UNSIGNED NOT NULL,
      role_id INT(11) UNSIGNED NOT NULL 
    );
    
    CREATE TABLE role (
      id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
      name VARCHAR(125)
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.