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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:08:29+00:00 2026-05-23T01:08:29+00:00

I have an application with multiple users with different roles. Each users access to

  • 0

I have an application with multiple users with different roles.
Each users access to a resource is limited by the role he has.

Now if I am building an application to manage these resources how should I structure my application.

roles : admin, moderator, author
resources: articles

I see two options.

1: Create separate modules for each role with give access to resources for the role
eg:
admin/
-add/edit/delete article
-add/edit/delete user
author/
-add/edit/delete own articles
moderator/
-edit articles

2: Create separate modules for each resource and give access to them based on the role of the user accessing them.
eg:
articles/ add/edit/delete [manage operations depending on the user’s role ]

The language is PHP and I will be using Zend framework. My issue is not about access permissions since Zend’s ACL component takes care of it. My issue is with organization of the application.

For example if a new user is introduced, in the first case I will have to create a new module. But in the case of the second method, I will have to update each and every module.

It is obvious that first approach will involve more files and less complex logic
second approach will need more complex logic but I am simply not sure of which one to follow and looking for advice. Any help is appreciated.

Thanks.

  • 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-23T01:08:30+00:00Added an answer on May 23, 2026 at 1:08 am

    I think general approach would be to keep access logic with accessed resource, not with accessing one.

    In your example it would mean that if article wants to be edited only by specified users, then it’s article’s business to check who edits it.

    All of the logic would be something like:

    if user is article.owner or admin
        ...make things happen
    

    and if you ever want to add new user role or change behavior of existing ones, you only need to edit this one condition rather than create another pretty-much-the-same-yet-a-bit-different user module.

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

Sidebar

Related Questions

I have an application that has multiple states, with each state responding to input
I have a TreeView control in my WinForms .NET application that has multiple levels
I am working on a web application where different user groups have different access
I have an application with multiple "pick list" entities, such as used to populate
I have an application deployed into multiple zones and there are some issues with
I have an application running on multiple IIS servers that need to parse a
I have an application that runs transactions spanning over multiple databases on the same
Here at work we have a very large application with multiple sub applications. (500
I have multiple threads (C# application running on IIS) running that all need to
I have multiple layers in an application and i find myself having to bubble

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.