Welcome Guest, Not a member yet? Register   Sign In
Simple way to show admin links based on user permissions
#4

[eluser]CroNiX[/eluser]
2 things.
1) In views, use if/then to show links to people according to their userlevel (or hide)
2) in the controller, make sure those controllers/methods are secured in that only a logged in user can access them, AND they have to have the correct access

So, if someone somehow knew a link that they shouldn't know about, if they tried to follow it they still wouldn't be allowed.

Code:
//only show the link to administrators and editors
<?php if ($this->user->has_role('admin', 'editor')): ?>
<a href="/admin/some_controller/some_method/some_article_id">Edit Article</a>
&lt;?php endif; ?&gt;
Of course, the above would totally depend on whatever your authentication allows...Its just an example.


Messages In This Thread
Simple way to show admin links based on user permissions - by El Forum - 12-01-2012, 03:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB