I wanted to use the_content filter to check the post categories. If a post has certain categories selected, depending on the user I want to return a message saying something like 'Sorry, you cannot view this', rather than the content itself.
Having added the filter though, have discovered, the_content filter does not pass the post id or post into the function, so I cannot check the post to see if the conditions are met.
Can anyone suggest a way of doing this, without updating all the page templates?