The code below works as far as removing the role from the user, just need to figure out why it is not instantly removing the tab (it doesn't look like it's actually relogging the user and clearing out the cache)
'remove the user from the Survey Role
Dim objRoleController As New Roles.RoleController
'objRoleController.UpdateUserRole(PortalId, UserId, objRoleController.GetRoleByName(PortalId, "Survey").RoleID, True)
objRoleController.DeleteUserRole(PortalId, UserId, objRoleController.GetRoleByName(PortalId, "Survey").RoleID)
UserController.UserLogin(PortalId, UserInfo, PortalSettings.PortalName, GetIPAddress, True)
'Remove user from cache
Dim objUser As UserInfo = UserController.GetCachedUser(PortalSettings.PortalId, Context.User.Identity.Name)
If objUser IsNot Nothing Then
DataCache.ClearUserCache(PortalSettings.PortalId, Context.User.Identity.Name)
End If
Thanks,
Val