Skip to content

Commit

Permalink
[#2939] Replace get editable groups in base controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 9, 2012
1 parent 92fcd77 commit 606ea35
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ckan/lib/base.py
Expand Up @@ -469,12 +469,8 @@ def _get_timing_cache_path(self):

@classmethod
def _get_user_editable_groups(cls):
if not hasattr(c, 'user'):
c.user = model.PSEUDO_USER__VISITOR
import ckan.authz # Todo: Move import to top of this file?
groups = ckan.authz.Authorizer.authorized_query(
c.user, model.Group, action=model.Action.EDIT).all()
return [g for g in groups if g.state == model.State.ACTIVE]
# get editable groups for current user
return h.groups_available()

def _get_package_dict(self, *args, **kwds):
import ckan.forms
Expand Down

0 comments on commit 606ea35

Please sign in to comment.