views:

16

answers:

1

I'm looking at writing a custom RoleProvider to talk to an external third-party system. However, the "roles" I need aren't explicitly defined in the system but are instead based on conditions within the system. For example, a role might be defined as someone who is assigned to a particular committee or someone who is at a particular level of membership. This means that the system has no concept of the roles I want to use and no mechanism for defining them. Clearly the role maintenance methods are meaningless here and would remain unimplemented, but the role query methods have to have the roles defined somewhere.

How can I define and use a roles in a situation like this? Maintaining a separate database for this information would be a nightmare. In addition, this framework would be used in multiple deployments where the roles would be completely different. I keep thinking that I need to code some sort of system with role objects that contain the logic required to determine if a user is in that particular role, but I can't figure out how to make it work with the Role Provider model.

Am I missing something blatantly obvious? Am I going about this completely wrong?

A: 

Hey,

Well, you could do a few things; you could create a role provider to take their position within your system (committee member, etc.) and translate that into a role string. Obviously, you'd want to do this once and cache them, but that is a possibility.

The other option is to skip the roles feature that's in built, and within your pages just check their status and validate them based upon that; for instance, do they have access to view this committee, check if they are a member, and allow them; otherwise, deny them. That sort of thing.

HTH.

Brian