I am programatically adding a AD user to some SharePoint groups.
spWeb.AllowUnsafeUpdates = true;
SPUser lookupUser = spWeb.EnsureUser(username);
if (lookupUser != null)
{
spGroup.AddUser(lookupUser);
}
spWeb.AllowUnsafeUpdates = false;
Have tried running this, as (logged in with the administrator account) and tried running with elevated privileges.
The user is added to the groups as required. The problem is, when I use the SharePoint function "Check Permissions" under "Site Permissions" it shows the user as having no permissions.
Everywhere I look in the internet simply shows the use of the AddUser method. Am I missing something?