Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Thu, 31 Jul 2008 03:24:07 -0700 (PDT),    group: microsoft.public.platformsdk.security        back       


Problem in authorization Manager while using AzRoles.dll   
Hi All,

I am creating custom RoleManager by using AzRolesLib.dll. I am facing
one problem that is in the method of IsUserInRole(string userName,
string roleName). The method definition is given below
	public override bool IsUserInRole(string userName, string roleName)
	{
     		string[] usersInRole = this.GetUsersInRole(roleName);

     		foreach (string currentUserName in usersInRole)
		{
                  	   if (string.Compare(currentUserName, UserName,
true) == 0)
    		   {
        			 return true;
    		   }
                	}
       	    return false;
	}

	public override string[] GetUsersInRole(string roleName)
	{
		AZROLESLib.IAzApplication application = this.OpenApplication();
		string[] usersInRole = null; AZROLESLib.IAzApplicationGroup
group=application.OpenApplicationGroup(roleName, null);
		object[] userNames = group.MembersName as object[];
		int limit = userNames.Length; usersInRole = new string[limit];
		for (int index = 0; index < limit; index++)
		{
 	  	   usersInRole[index] = userNames[index] as string;
		}
    	       return usersInRole;
	}


GetUsersInRole method is listing the users which are there in that
role if we add users in AzManStore.
In this case it is fine. Suppose if we use groups(Domain Users /Domain
Admin) in the AzMan store,
it is not returning the list of users in that group instead, it is
listing only the group name.
So i can't use the above method "IsUserInRole(string userName, string
roleName)" if we add the group in
the azman store instead of users, Since userName will not match with
the returned group name in method
GetUsersInRole(string roleName).
Is there any way to solve this problem?

Thanks in advance.

Hari



Filed under: active Director roles authorization
date: Thu, 31 Jul 2008 03:24:07 -0700 (PDT)   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us