Skip to content

Commit

Permalink
[#2939] Update get action organization_list_for_user()
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 10, 2012
1 parent 63a2fdd commit ef74b00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ckan/logic/action/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,11 @@ def organization_list_for_user(context, data_dict):

_check_access('organization_list_for_user',context, data_dict)

roles = ckan.new_authz.get_roles_with_permission('edit_group')

q = model.Session.query(model.Member) \
.filter(model.Member.table_name == 'user') \
.filter(model.Member.capacity.in_(roles)) \
.filter(model.Member.table_id == new_authz.get_user_id_for_username(user))
group_ids = []
for row in q.all():
Expand Down

0 comments on commit ef74b00

Please sign in to comment.