When following Microsoft best practices for user permissions and using a different user for every application pool user identity, the access denied error when activating the publishing infrastructure in the site collection features, is an error that I have run across multiple times over the last couple of months.  It’s an annoying error without much information, but as it turns out, it is really easy to fix.  To enable the publishing infrastructure without changing any permissions simple do the following:

1. Log in to your SharePoint server as your SharePoint Administrator

2.  Open up a command prompt, if you haven’t add the SharePoint bin directory to your environment variables, browse to C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12Bin

3. Run the command stsadm –o activatefeature –name PublishingResources –url [your site url].

4.  Browse to your site in your site collection, Site Settings, Site Collection Features and activate your Publishing Infrastructure.  It should activate without any errors.