Hi,Well... After reading your RBAC and what Chuck uses, my stuff looks pretty plain. Anyway I was writing this class while posting the original msg of this thread so I decided to share.
It's not even alpha... I've not had the time to even run it twice (I'm serious) so just check the idea, not the code. I fixed some fast JavaDoc comments in the code. ;)
http://rdm.rdm-web.com/jSamples/Privileges.java.htmlIt's a centralized class to store all privileges in compact BitSets. It's designed with static constructors to fit perfectly in the "Custom" attribute scenario of the wolips entity modeler.
My "User" entity has an attribute like the following:
<<inline: eosetup.png>>
Different classes can define and use their privilege with a static block without any prior knowledge of other privileges. Also classes define their privilege in "their" files and use them there as well. This keeps me from cluttering all my app with references to privileges that might not exist anymore.
I decided to use the static block constructor cause I feel that since the code "relies" on the privileges, defining them in property files paves the road to problems. This also gives me a startup check that privileges don't conflict. I'm not happy of the redundant ID/CODE thing I picked and of the need to manually choose a unique ID, but I can live with it. After reading Chucks post I think I'll look into ways of making it work seamlessly with KVC.
Any comments/bugs are absolutely welcome. It's a work in progress so I'd love advice from others and as Kieran, I'm curious about how you do it yourself.
rdm
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com