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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:57:22+00:00 2026-05-30T05:57:22+00:00

Are there any classes (free, open source or commercial) that perform access control similar

  • 0

Are there any classes (free, open source or commercial) that perform access control similar to what Java’s AccessController does? I want to create a dynamic set of policies that can be changed at runtime.

But, I want to avoid having to code

if Allowed( ... ) then

all over the place. I know that I probably need to adjust my program class hierarchy, but I prefer that instead of manually adding guards all over the place.

If there are is no ready-to-use code, what would be a sensible approach? RTTI?

Edit: Here’s an example from the Security Annotations and Authorization in GlassFish and the Java EE 5 SDK article. Since somebody mentioned annotations in a comment, I think this would be ideal:

@Stateless
@RolesAllowed("javaee")
public class HelloEJB implements Hello {
    @PermitAll
    public String hello(String msg) {
        return "Hello, " + msg;
    }

    public String bye(String msg) {
        return "Bye, " + msg;
    }
}

From the article:

In this example, the hello() method is accessible by everyone, and the bye() method is accessible by users of role javaee.

Edit:
Well, it appears that the general consensus is that this can’t be done in Delphi. Others think it is a bad approach.

Me, I still think this would be great. My experience with Annotations in Java (as a code monkey way down in the totem pole) is positive. You add a new method, you add some form of annotation (not exactly the same as Java Security Annotations) and you are done. An administrator can later go to the admin panel and add grant access to this new handler to a group or individual users. It just works.

These are my current alternatives:

  1. The TMS Security System – this appears like a complete solution, with several tools. Worth looking into. I’m accepting this as an answer even if I’m probably not going for it.
  2. This is something that looks promising: Delphi virtual method interception. It only works on virtual methods, but I don’t think that’s too difficult to comply. This and annotations could make an interesting system (it appears that this was originally designed for DataSnap authentication)
  3. Having only one ActionManager in your application, and make sure that all actions can be only initiated from there. This way you can use the action manager OnExecute method; I pretend to use the TAction.Name property as the permission name (“handler”), reading a list of allowed actions from a table. I can use the action list from the action manager to display the whole list in the admin UI.
  • 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-30T05:57:24+00:00Added an answer on May 30, 2026 at 5:57 am

    There is no such framework for Delphi yet, nor a concept like EJBs that would fit with it. DELPHI does support class annotations, and a framework like this could be designed, perhaps in conjunction with TAction, to provide security on an action level, but I doubt that this could be extended to blocking specific method calls. Delphi code does not ever ask permission to invoke a virtual method. Anything that injected itself into EVERY virtual method call in Delphi, adding a checkPermission call behind the scenes would (in my opinion) be evil. It would be Slow, and worse than writing such checks in by hand.

    However, the same techniques that are used to Mock delphi classes could perhaps be used to create some auto-security wrapper object in the future.

    I am guessing that the if the Java library in question used Aspects (essentially “injection” implemented via a technique like code-hooking) then it would not require “CheckAllowed” calls everywhere. If you didn’t mind changing all your method invocations to implementing an interface, and then providing a wrapper that did the method invocations, and used some kind of auto-generated mock-security-wrapper around it, you could avoid calls to CheckAllowed.

    So a guarded No, with a “limited framework possible in future” clause.

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

Sidebar

Related Questions

Are there any easy-to-use , high-level classes or libraries that let you interact with
Is there any free program out there that can parse a collection of VHDL
Is there any free dll that can be used for PDF generation because I
Are there any other classes provided by php5+ such as the mysqli() class? for
Is there any overhead using partial classes in case of memory, performance etc? If
Is there any gain to combining all of the classes for a project into
Is there any way to make a list of classes behave like a set
Is there any way to detect when classes have changed during run-time with Hotswap?
Is there any way we can inject new methods and properties into classes during
Is there any method to add intellisense to designer-generated classes and properties in LINQ

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.