Different Type of User Pattern

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's the best design/pattern to use for a windows app that has different
types of users, and where different things happen according to what type of
user you are.

For example: If you're User A then a button will be visible, however if
you're user B, then that button will not be visible. But on a much larger
scale than this example.

Thanks
 
Criag,

Well, the pattern that is already establised uses implementations of the
IPrincipal object. A principal can be in different roles, and you can check
that principal at any point (you can get it off the current thread).

Basically, you would get your IPrincipal implementation, and then check
to see if it is in the role you specify. If it is, you perform your action,
if not, you perform some other action (like enabling/disabling a control).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top