Problem using role_has_cap hook

I finally figured it out:

To start with, I was using the wrong hook. I should have been using user_has_cap hook instead, which is what actually has a chance of being called when using current_user_can().

But second, and most important of all, I was seeing the page while logged-in as super_admin, which didn’t trigger the apply_filter function at all. Since by definition the super_admin has all capabilities, WP doesn’t feel the need to filter any of the checks.