06-24-2017, 01:16 PM
Ok. So you have access to a few things already.
You have
$currentPage
which gives you the page name and you have
$pagePermissions = fetchPagePermissions($id);
which gives you the permissions for that page if you have the id.
So all you need to do is to do a db query from the pages table to get the id of the current page.
Then you can run
$pagePermissions = fetchPagePermissions($id);
Then you can build an array of permission ids from that.
After that, the normal hasPerm function will work like it always has.
I hope that's a point in the right direction.
You have
$currentPage
which gives you the page name and you have
$pagePermissions = fetchPagePermissions($id);
which gives you the permissions for that page if you have the id.
So all you need to do is to do a db query from the pages table to get the id of the current page.
Then you can run
$pagePermissions = fetchPagePermissions($id);
Then you can build an array of permission ids from that.
After that, the normal hasPerm function will work like it always has.
I hope that's a point in the right direction.