Skip to content

Commit

Permalink
[#2600] Fix Login to add Organization button
Browse files Browse the repository at this point in the history
Just don't show any button if not authorised to add organisations, same
as with e.g. add dataset etc.

Also fix broken group_create auth function
  • Loading branch information
Sean Hammond committed Jun 27, 2012
1 parent dccd6ea commit d28ba93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ckan/logic/auth/publisher/create.py
Expand Up @@ -79,7 +79,7 @@ def group_create(context, data_dict=None):
model = context['model']
user = context['user']

if not user:
if not model.User.get(user):
return {'success': False, 'msg': _('User is not authorized to create groups') }

if Authorizer.is_sysadmin(user):
Expand Down
5 changes: 1 addition & 4 deletions ckanext/organizations/templates/organization_layout.html
Expand Up @@ -33,12 +33,9 @@
<li class="${'active' if c.action=='index' else ''}">
${h.subnav_named_route(c, h.icon('group') + _('List Organizations'), "organization_index", action="index" )}
</li>
<li style="display:none;" class="ckan-logged-in ${'active' if c.action=='new' else ''}">
<li py:if="h.check_access('group_create')" class="${'active' if c.action=='new' else ''}">
${ h.subnav_named_route(c, h.icon('group_add') + _('Add an Organization'), "organization_new", action='new')}
</li>
<li class="ckan-logged-out ${'active' if c.action=='new' else ''}">
${h.subnav_link(c, h.icon('group_add') + _('Login to Add an Organization'), controller='group', action='new')}
</li>
</py:otherwise>
</ul>
</py:match>
Expand Down

0 comments on commit d28ba93

Please sign in to comment.