Skip to content

Commit

Permalink
[#2375] only show add package link if have permission
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jun 12, 2012
1 parent 2fb317f commit 360c077
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ckan/lib/helpers.py
Expand Up @@ -379,7 +379,9 @@ def build_nav_main(*args):
'''
output = ''
for item in args:
menu_item, title = item
menu_item, title = item[:2]
if len(item) == 3 and not check_access(item[2]):
continue
output += _make_menu_item(menu_item, title)
return output

Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/header.html
Expand Up @@ -28,7 +28,7 @@ <h1><a href="{{ h.url('home') }}">{{ g.site_title }}</a></h1>
{% endif %}
<nav>
<ul class="unstyled">
{{ h.build_nav_main(('search', _('Search')),('default_group', _('Groups')), ('add dataset', _('Add Dataset')), ('about', _('About'))) }}
{{ h.build_nav_main(('search', _('Search')),('default_group', _('Groups')), ('add dataset', _('Add Dataset'), 'package_create'), ('about', _('About'))) }}
</ul>
</nav>
</div>
Expand Down

0 comments on commit 360c077

Please sign in to comment.