EDIT: I may have overlooked or the error has changed, but can() seems not to be the problem, but the $article?:
Call to a member function can() on null
OP (how to spoiler this text?):
I don’t know what could be wrong with my setup. I checked with the files of lukec8 and it seems OK (the same components setup and some differences in ArticlePolicy and ArticleController though).
So I guess I have to dig a little deeper. What object is the $id below? And to make sure, $this is a View? Is there a console where I can test with gettype()? Then I may find out where $id is missing the link with IdentityInterface.
$id = $this->request->getAttribute('identity');