08-23-2016, 12:38 PM
There are not built in functions for doing that, but I could definitely see the use case for it. By default those permissions are designed only to control access to particular pages, but there is no reason why that functionality could not be extended.
Just fyi, you can always get the id of the logged in user by putting
You'll notice that we also do something similar with the menus. The menu looks at the permission level of the logged in user. In fact, there is a function for that.
You may want to play with that checkMenu function. It might be a slightly faster (but less flexible) way to do that rather than querying manually.
Just fyi, you can always get the id of the logged in user by putting
Code:
$user->data()->id;
You'll notice that we also do something similar with the menus. The menu looks at the permission level of the logged in user. In fact, there is a function for that.
Code:
if (checkMenu(2,$user->data()->id)){ //Links for permission level 2 (default admin) ?>
You may want to play with that checkMenu function. It might be a slightly faster (but less flexible) way to do that rather than querying manually.