Conditionally show the "new post" link for users with the permission to add posts.

This commit is contained in:
Raoul Snyman 2010-01-19 22:44:25 +02:00
parent e55abb024f
commit 3ad5f581d4

View File

@ -20,7 +20,9 @@
<li><a href="${page.url}">${page.name}</a></li>
% endfor
% if c.current_user:
% if c.current_user.has_permission('Add Posts'):
<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:
<li><a href="${h.url_for(controller='admin', action='login')}">Login</a></li>