Article View: borland.public.jbuilder.java.swing
Article #652Re: Application Security
From: Tony
Date: Mon, 18 Apr 2005 07:36
Date: Mon, 18 Apr 2005 07:36
32 lines
2097 bytes
2097 bytes
David, I have recently developed a framework to accomplish the same objective. I can suggest the following implementation hints. I apologize if they sound trivial. 1. Make sure that all actions in your application are implemented as Swing Actions. I implemented an extension to AbstractAction, which in addition to many other things encapsulates a security token which allows to check it's permission against a set of security tokens, managed by your own security implementation. That way, when you define your action in one place in your application in the same place you give it a security token. 2. Never build your menus/trees manually. Define your own nested data structure, which you will use to code a nested set of Actions. Then pass your data structure to a factory method, which can generate a tree or a menu, based on the data structure. Among other things your factory method can easily check permissions for the security token in the Action and choose to exclude the node from the tree based on the results of such check, naturally if your factory will be building a menu you can choose whether to keep the action as disabled or omit it. Tony.
Technical Details
Message-ID:
<42636366$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4262b095$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,d9ed453df48acb90 X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Tony" <aoganesi_a^t_yahoo_._com> Newsgroups: borland.public.jbuilder.java.swing References: <4262b095$1@newsgroups.borland.com> Subject: Re: Application Security Date: Mon, 18 Apr 2005 00:36:17 -0700 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 69.33.38.98 Message-ID: <42636366$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1113809766 69.33.38.98 (18 Apr 2005 00:36:06 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail