cakephp3 – fixing the index method for admin and normal user

23666Say for example you dont want normal users being able to see a list of items in this example lets say its questions. ┬áBut at the same time you want an “admin” user to be able to see them.

The following function might help;

What it does:
basically if does a different pagnate depending in the user’s role.