ACL check in the view

281 Views Asked by At

Well in ZF1 there was the isAllowed view helper to check the ACL in the view.

But I can't find an equivalent of it for ZF2. The closest I got was the ZF2 navigation view helper, but the problem with that is that it requires a AbstractPage. I just want to throw a resource/privilege to it, example:

$this->allowed('resource', 'privilege');

Is there not such a view helper, or am I looking at this all the wrong way?

1

There are 1 best solutions below

3
MKroeders On BEST ANSWER

Well I couldn't find any view helper, neither got any response so I wrote my own view helper.

isAllowed view helper code