I can think of two reasons why "assigning read permissions to extranet\anonymous doesn't help":
Issue A: The requirements or architecture of your site means that permissions aren't helpful to solving this problem.
For example, a situation where you want an item to be secured most of the time, but need to allow anonymous users to read a summary of it before they have authenticated correctly.
Here you can use code to override the user context being used to load the item. The simplest, but most dangerous approach is this:
using (new Sitecore.SecurityModel.SecurityDisabler())
{
var item = Sitecore.Context.Database.GetItem("/path/to/item");
// further processing
}
That just turns off Sitecore's security enforcement inside the using statement. Hence the danger. Don't put anything that's really security sensitive inside that block.
Alternatively you can change the security context to a different user for the duration of a block of code with
var user = Sitecore.Security.Accounts.User.FromName("domain\username", false);
using (new Sitecore.Security.Accounts.UserSwitcher(scUser))
{
var item = Sitecore.Context.Database.GetItem("/path/to/item");
// further processing
}
This is the preferred approach - as you are still using security - just temporarily for an account with more rights than the context user.
Issue B: Permissions should be the right answer for your solution, but do not work in this case.
If this is the case, it's pretty much impossible to address your problem without more details of your Sitecore install and what your site is trying to do. If this applies to you then you may do better to talk to Sitecore Support to diagnose why the user rights are not being correctly applied in your site. They will be able to look at your configuration, code and log files to try and work out the underlying issue.