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

  • Home
  • SEARCH
  • 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 613799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:02:34+00:00 2026-05-13T18:02:34+00:00

Background Weekly we will get some users calling out for help why thy can’t

  • 0

Background

Weekly we will get some users calling out for help why thy can’t do X on form Y.
Because of complex business rules, we often have to revert looking in the code ourselves to know why that particular action is not available at that time. Are there any proven strategies to deal with this?

How does one collect all the information from the GUI, business rules and/or security that leads to disabling a button?

Example

The user can’t remove a measurement from the measurement overview form because

GUI

  • there is no measurement selected in the form.
  • there are multiple measurements selected in the form.

Business rules

  • the selected measurement has been used in a calculation.
  • the selected measurement is linked to (what we call) a productfiche.

Security

  • the current user is not a member of the group of analysts responsible for that particular measurement.
  • the current user is not an analyst.

Edit

Regarding the valid comments about the fact that we’ve already made a calculation to decide if the control should be disabled.

We use a home brew ACL to handle security. These are the steps to decide if a control should be disabled

  • A Global ACL is retrieved (currently from a database). If a Write ACE in the ACL for the measurement property is present, this indicates that the current user has the right to change the measurement.
  • A measurement business object gets a copy of this global ACL. The business object puts his business rules on top of the retrieved ACL. If the business rules dictate that the measurement should not be writable, it adds a Deny Write ACE to the ACL.
    Note that a business object can only make the security more restrictive. If global security dictates it can’t be done, it can’t be done.
  • The coupling with the business object’s ACL and the GUI is done through what we call our GuiMap object. This object retrieves a copy of the ACL from the business object and allows the developer to add function pointers returning booleans to it to add Gui rules on top off the business objects ACL.

Now to determine if a button should be enabled, the GuiMap evaluates every function passed to it in combination with the security determined by the ACL of the business object and in extremis with the security of the user.

  • If the user has no rights, the result is always disabled.
  • else if the business rules say it should be disabled, it is disabled.
  • else if any one Gui rule says it should be disabled, it is disabled.

So in fact, every layer builds on top of the previous to determine the final outcome. It is not like there will be one calculation to determine if a button or anything else should be enabled.

The beauty if you like is this: as ACL’s hand out copies, the copies attach themselves to the master and get notified when their master ACL get’s updated. This allows us to

  • let every control get updated if a users logs off/on in anyone screen.
  • let every control get updated on a change in the business object demands it.

This works quite well for us, except that it is hard to know why something is disabled.

  • 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-13T18:02:34+00:00Added an answer on May 13, 2026 at 6:02 pm

    If I understand you correctly, you have two separate problems:

    1) The checks in each layer just return a boolean indicating enabled / disabled, and don’t return the reason.

    You would have to change that such that each check also returns the reason; e.g. you could return a tuple (enabled, reason), where access is the boolean that you have now, and reason a description of the reason why it is disabled (e.g. as a string).

    Depending on the environment you are working in, changing the return type of all access checks may not be feasible; if you want to avoid this, you could report the reason “out of band”, e.g. stash it into a global (or rather thread-local) variable, a la errno in UNIX or GetLastError in Windows. That’s not that elegant, and will certainly be frowned upon by many, of course 🙁

    Alternatively, you could change your checks to throw exceptions (with a descriptive message) instead of returning a boolean. Again, this will be frowned upon in many environments…

    2) Your business layer adds entries to the object’s access control lists. When you later check the access, you know which entry denied the access, but you don’t know anymore, why this entry has been added.

    Th solve this, you could add a reason field to the ACEs. When the business layer adds an ACE, it sets the reason to a description of the reason why the access was denied. The access control check then reads the reason from here and passes it up to the GUI layer as described above.

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

Sidebar

Ask A Question

Stats

  • Questions 301k
  • Answers 301k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You are correct - the headers method of ActionController::Request returns… May 13, 2026 at 8:08 pm
  • Editorial Team
    Editorial Team added an answer How about something like this? -- Helper Procedure CREATE PROC… May 13, 2026 at 8:08 pm
  • Editorial Team
    Editorial Team added an answer From a user/browser point of view, the session is passed… May 13, 2026 at 8:08 pm

Related Questions

We currently have a group of web-services exposing interfaces to a variety of different
Background: I need to provide a weekly report package for my sales staff. This
Background: I have a little video playing app with a UI inspired by the
Background: At my company we are developing a bunch applications that are using the
Background: Some time ago, I built a system for recording and categorizing application crashes

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.