Problem in authorization Manager while using AzRoles.dll(.Net)



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

.



Relevant Pages

  • Problem in authorization Manager while using AzRoles.dll
    ... public override bool IsUserInRole(string userName, string roleName) ... Admin) in the AzMan store, ...
    (microsoft.public.platformsdk.security)
  • Re: Roles in membership database
    ... private void MapUsersToRoles() ... foreach (string userAndRole in this._toDoUserAndRoleValues) ... if (!Roles.IsUserInRole (userName, roleName)) ... Roles.AddUsersToRole(new string{userName}, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Roles in membership database
    ... Membership classes - thanks for your help. ... if (!Roles.IsUserInRole (userName, roleName)) ... Roles.AddUsersToRole(new string[] {userName}, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Roles in membership database
    ... private void MapUsersToRoles() ... if (!Roles.IsUserInRole (userName, roleName)) ... Roles.AddUsersToRole(new string[] {userName}, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ADAM and AuthorizationStoreRoleProvider
    ... ADAM roles to ADAM users only. ... // Global connection string, generic exception message, event ... foreach (string rolename in rolenames) ...
    (microsoft.public.dotnet.framework.aspnet.security)

Loading