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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:00:56+00:00 2026-05-12T22:00:56+00:00

I have a classic 3-tier ASP.Net 3.5 web application with forms that display business

  • 0

I have a classic 3-tier ASP.Net 3.5 web application with forms that display business objects and allow them to be edited. Controls on the form correspond to a property of the underlying business object. The user will have read/write, readonly, or no access to the various controls depending on his/her role. Very conventional stuff.

My question is: what is the object-oriented best practice for coding this? Is there anything more elegant than wrapping each control in a test for the user’s role and setting its Visible and Enabled properties?

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-12T22:00:56+00:00Added an answer on May 12, 2026 at 10:00 pm

    To work properly, I have found that access levels should be in this increasing order:
    NONE, VIEW, REQUIRED, EDIT.

    Note that REQUIRED is NOT the top level as you may think it would be since EDIT (both populate & de-populate permission) is a greater privilege than REQUIRED (populate-only permission).

    The enum would look like this:

    /** NO permissions.
     *     Presentation: "hidden"
     *     Database: "no access"
     */
    NONE(0),
    
    /** VIEW permissions.
     *     Presentation: "read-only"
     *     Database: "read access"
     */
    VIEW(1),
    
    /** VIEW and POPULATE permissions.
     *     Presentation: "required/highlighted"
     *     Database: "non-null"
     */
    REQUIRED(2),
    
    /** VIEW, POPULATE, and DEPOPULATE permissions.
     *     Presentation: "editable"
     *     Database: "nullable"
     */
    EDIT(3);
    

    From the bottom layer (database constraints), create a map of fields-to-access. This map then gets updated (further restrained) at the next layer up (business rules + user permissions). Finally, the top layer (presentation rules) can then further restrain the map again if desired.

    Important: The map must be wrapped so that it only allows access to be decreased with any subsequent update. Updates which attempt to increase access should just be ignored without triggering any error. This is because it should act like a voting system on what the access should look like. In essence, the subsequent layering of access levels as mentioned above can happen in any order since it will result in an access-level low-water-mark for each field once all layers have voted.

    Ramifications:

    1) The presentation layer CAN hide a field (set access to NONE) for a database-specified read-only (VIEW) field.

    2) The presentation layer CANNOT display a field when the business rules say that the user does not have at least VIEW access.

    3) The presentation layer CANNOT move a field’s access up to “editable” (nullable) if the database says it’s only “required” (non-nullable).

    Note: The presentation layer should be made (custom display tags) to render the fields by reading the access map without the need for any “if” statements.

    The same access map that is used for setting up the display can also be using during the submit validations. A generic validator can be written to read any form and its access map to ensure that all the rules have been followed.

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

Sidebar

Related Questions

I have a classic ASP application currently secured using ASP.NET Forms Authentication running on
We have a three-tier architecture consisting of Classic ASP Frontend, VB COM+ Objects and
We have a classic ASP application that simply works and we have been loathe
NET and VB.net code behind. I have a classic ASP page that connects to
I have a classic ASP application that I've been constantly trying to modularize. Currently,
I have some classic asp code that needs converting to asp.net. So far I
We have a classic ASP page that is instantiating a .Net object through a
we have a classic asp web application which has divided into three parts and
I have an ASP Classic application which references some VB6 COM OBJECTS. One of
I have a classic 3-tier web application build with MySQL and Tomcat. I want

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.