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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:47:25+00:00 2026-06-02T18:47:25+00:00

I’m developing an application for our company that eventually will have lots of ways

  • 0

I’m developing an application for our company that eventually will have lots of ways of restricting users to particular sections/modules. While the application is still small, I’d like to move to a new method of storing permissions that, as the application grows, will remain easy to maintain and query.

Currently in our MySQL database we have a table called “user” which stores the user’s ID, username and password. In a separate table called “user_acl” is the following:

user_acl_id
acl_root
acl_news_read
acl_news_write
acl_news_modify
acl_reports_read
acl_reports_write
acl_reports_modify
acl_users_read
acl_users_write
acl_users_modify

We only have 3 modules at the minute, but over time more will be created and permissions for each will need to be added.

Rather than create a column for each permission, is there any other way or storing this information?

  • 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-06-02T18:47:28+00:00Added an answer on June 2, 2026 at 6:47 pm

    I would do it this way.

    table name: permission
    columns: id, permission_name
    

    and then I can assign multiple permissions to the user using a many to many relationship table

    table name: user_permission
    columns: permission_id, user_id
    

    This design will allow me to add as many permission as I want, and assign it to as many user as i want.

    While the above design go with your requirement, I have my own method of implementing ACL in my application. I am posting it here.

    My method of implementation of ACL goes like this:

    1. User will be assigned a role (Admin, guest, staff, public)
    2. A role will have one or many permissions assigned to them (user_write, user_modify, report_read) etc.
    3. Permission for the User will be inherited from the role to which he/she is
    4. User can be assigned with manual permission apart from the permission inherited from role.

    To do this I have come up with the following database design.

    role
    I store the role name here 
    +----------+
    | Field    |
    +----------+
    | id       |
    | role_name |
    +----------+
    
    permission:
    I store the permission name and key here 
    Permission name is for displaying to user.
    Permission key is for determining the permission.
    +----------------+
    | Field          |
    +----------------+
    | id             |
    | permission_name |
    | permission_key  |
    +----------------+
    
    role_permission
    I assign permission to role here 
    +---------------+
    | Field         |
    +---------------+
    | id            |
    | role_id       |
    | permission_id |
    +---------------+
    
    user_role
    I assign role to the user here 
    +---------------+
    | Field         |
    +---------------+
    | id            |
    | user_id       |
    | role_id       |
    +---------------+
    
    user_permission
    I store the manual permission I may allow for the user here 
    +---------------+
    | Field         |
    +---------------+
    | id            |
    | user_id       |
    | permission_id |
    +---------------+
    

    This gives me more control over the ACL. I can allow superadmins to assign permission by themselves, and so on. As I said this is just to give you the idea.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.