|
-
Jun 10th, 2003, 03:13 PM
#1
Thread Starter
PowerPoster
Is there a way to read the actual Role from code
Is there a way to read the actual Role of a user on the Network from code rather than having to pass in the String of that role?
I want to know the "MyLAN\Web Dev Group" from an object of some sort. Does it exist?
THanks
Code:
If HttpContext.Current.User.IsInRole("MyLAN\Web Dev Group") Then...
-
Jun 10th, 2003, 03:21 PM
#2
A user is usally in many roles. You could probably use the DirectorySevices namespace to get the group object but find who belongs to it. Although the objects there tend to be a bit generic.
-
Jun 10th, 2003, 03:25 PM
#3
Thread Starter
PowerPoster
So I take it that this namespace actually can query the Active Directory?
-
Jun 10th, 2003, 05:21 PM
#4
Yes.
This is an example of getting all the groups a user belongs to:
http://www.vbcity.com/forums/topic.a...1346&#RID64857
-
Jun 11th, 2003, 07:18 AM
#5
Thread Starter
PowerPoster
Hey that is great code on the other site! Did you actually implement it?
-
Jun 11th, 2003, 09:32 AM
#6
Yes I made a custom RoleUser class for misc things and a role based security thing I had to do.
-
Jun 11th, 2003, 09:34 AM
#7
Thread Starter
PowerPoster
I just implemented your code! Thanks for the work, it is VERY useful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|