Menu's etc. based on user level

I need to implement "user level" (available actions based on rights) functionality in my app .. this may affect everything from actions (menus, buttons) to available Fonts etc... suggestions? .. I was thinking of adding a "level" (int) to all my classes, and then creating a Factory that would initiate the menu's etc. ..

... but that would require me to initiate an action object before beeing able to tell that the user is allowed to use it or not..

[466 byte] By [borbjoa] at [2007-9-28 11:07:45]
# 1

1. What are you using this for and will you be using a DB?

2. If using a DB then see if there are already user levels there?

3. If not using a DB(Includes flat files) then I will have to look into it.

I have done this for my work and we have Approvers in our DB role=A or N

Approvers have a different menu. I needed to create an if statement and do duplicate code BUT I was still learning then.

1. Try to create a simple test data and create the method from that.

2. I will find my code example for you to see.

3. Good luck!

benc3a at 2007-7-12 1:28:35 > top of Java-index,Other Topics,Patterns & OO Design...