Conditionally show the "new post" link for users with the permission to add posts.
This commit is contained in:
parent
e55abb024f
commit
3ad5f581d4
@ -20,10 +20,12 @@
|
|||||||
<li><a href="${page.url}">${page.name}</a></li>
|
<li><a href="${page.url}">${page.name}</a></li>
|
||||||
% endfor
|
% endfor
|
||||||
% if c.current_user:
|
% if c.current_user:
|
||||||
<li><a href="${h.url_for(controller='post',action='new')}">New Post</a></li>
|
% if c.current_user.has_permission('Add Posts'):
|
||||||
<li><a href="${h.url_for(controller='admin',action='logout')}">Logout</a></li>
|
<li><a href="${h.url_for(controller='post', action='new')}">New Post</a></li>
|
||||||
|
% endif
|
||||||
|
<li><a href="${h.url_for(controller='admin', action='logout')}">Logout</a></li>
|
||||||
% else:
|
% else:
|
||||||
<li><a href="${h.url_for(controller='admin',action='login')}">Login</a></li>
|
<li><a href="${h.url_for(controller='admin', action='login')}">Login</a></li>
|
||||||
% endif
|
% endif
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user