Custom capability conflict with W3TC plugin

A user reported in the forums that while running W3 Total Cache with the New Relic setting enabled the Stream Records page disappears.

screen shot 2014-03-04 at 12 01 01 pm

I've isolated the problem to these lines in the W3TC plugin.

It seems that $current_user->roles is just an empty array when Stream is enabled.

If you change the VIEW_CAP constant to manage_options everything works perfectly fine. So something about the way Stream is using a custom capability might be causing a conflict here, but I haven't been able to pinpoint exactly which plugin is to blame.

/cc @kucrut @shadyvb