When I created a role with limited capabilities and logged in with a user with that role there were three lines of code appearing on the top of the admin pages. All of them included "jetpack". When I disabled jetpack the code disappeared. When i re-enabled it and added "view stats" capability to the role there was only one line of code at the top of the page. Anyway, I went through the capabilities until i found one that got rid of the code and that was "edit topics" which I think is from the bbpress plugin.