I;ve posted this here because I dont really care what lanaguage. It could be VB or C# its the logic of what we are trying to do I wasnt to discuss.
We have a requirment to develop a system which has a Custom User object of which each user can have many log-ins (Active Directory, Open Id, Standard Login, Facebook Connect etc etc)
We have begun work on a custom Role/Membership provider which involves changing some of the method signatures. So for example, our role-provider
The standard sig for this method isCode:public string[] GetRolesForUser(int UserId) { IEnumerable<Role> RoleList = _Repo.GetRolesForUser(UserId); string[] RetVal = new string[] {}; foreach (var curRole in RoleList) { RetVal[RetVal.GetUpperBound(0)] = curRole.RoleName; } return RetVal; }
Obviously the whole idea of writing custom membership providers is so we can use the existing security and functions.Code:public override string[] GetRolesForUser(string username)
So when I call
I would like to see the option to pass a Int as well as a string. At the moment that is not the case unless we cast the object to be our provider.Code:Roles.GetRolesForUser()
Which to me seems to defeat the purpose of what we are doing? Does anyone have any experiance of really heavily customising the Roles/Membership provider?Code:string[] myRoles3 = ((PortalRoleProvider) (Roles.Provider)).GetRolesForUser(2);
I understand why we need to cast the object but I dont think its what we were hoping to acheive.
And if the above way of doing things isnt going to work as we want is our only other option to create a Complete custom Membership class.
Suggestions welcome.




Reply With Quote