[eluser]boltsabre[/eluser]
If statements sound fine to me!
But I'd use int's, not names, so let's say you have a link the level 3 and 4 (editor & admin) can view it'd just be like this:
Code:
<?php if ($user_permission > 2): ?>
<a class="current" href="<?php echo base_url(); ?>dashboard" data-toggle="tooltip" data-placement="right" title="" data-original-title="Dashboard"> <i class="fa fa-home"></i> </a>
<?php endif; ?>
I'd be checking the user login status (and redirecting them if not logged in) and getting the user permission and assigning it to the $data variable in MY_Controller, that way you you're not calling class methods every time you want to check something in a view, you're just doing a greater than comparison. It's a bit quicker, and in my opinion a bit neater to have all this stuff hidden away in MY_Controller.
Another advantage is now in all your controllers you can also easily check the user permission and redirect them (or throw a 404 page) if they try to access a controller that they are not allowed to access.