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 6179835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:44:22+00:00 2026-05-24T00:44:22+00:00

We have an existing application that runs on php and mysql. We are in

  • 0

We have an existing application that runs on php and mysql. We are in the process of adding fine grained user authorization, so that certain users only get access to certain resources. There are a few thousand users and approx 100 resources (although both are expected to grow).

My DB design is something like:

users:
id, name, email

resources:
id, resource

OPTION 1
So, if we approached this with typical db normalisation in mind, we would have the following table as well. I guess that we would follow the structure of users being denied permission unless there is a record in the user_resources table. If their permission is subsequently removed for a particular resource, then we just delete that row from the user_resources table.

*user_resources:*
user_id, resources_id

OPTION 2
Another alternative would be to forget about the user_resources table and just create a new column in the users table (called permissions or similar) and store a serialized value of that users permissions in the users table. Each time we need to check a user’s permission, we would have to unserialize this value.

Which approach is considered better practice, and are there any major pro’s or con’s to either?

  • 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-24T00:44:24+00:00Added an answer on May 24, 2026 at 12:44 am

    Option 1 is the way to go unless you have solid arguments against it. Adding a column to the users table is fine for role based permissions. You can mix the two options, if you base your permissions on roles but allow to assign different permissions – then write in the table only the exceptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing SQL Server 2005 database that runs our accounting/inventory application. We
I have created an application that runs in the taskbar. When a user clicks
I have an application that runs hosted under the w3wp.exe process. While debugging, I
I have an existing application that is written in C++ for Windows. This application
We have an existing application that relies heavily on stored procedures and untyped DataSets.
I have an existing 32-bit ASP.NET application that used 32-bit unmanaged DLLs. If I
I have a custom HttpModule rewrite engine in an existing web application project that
I have a silverlight application that I am embedding in an existing ASP.NET web
I am working on splitting out an existing, working application that I currently have
I have a stored proc on an existing 3rd party application (SQL 2005) that

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.