Skip to content

Commit

Permalink
[2255] Only search for public datasets on /dataset/ and only show pri…
Browse files Browse the repository at this point in the history
…vate on /organization/ if current user is a member
  • Loading branch information
rossjones committed Mar 29, 2012
1 parent 88a4440 commit a8a5317
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ckan/controllers/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,14 @@ def pager_url(q=None, page=None):
else:
search_extras[param] = value


fq = 'capacity:"public"'
if (c.userobj and c.group and c.userobj.is_in_group(c.group)):
fq = ''

data_dict = {
'q':q,
'fq':fq,
'facet.field':g.facets,
'rows':limit,
'start':(page-1)*limit,
Expand Down
1 change: 1 addition & 0 deletions ckan/controllers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def pager_url(q=None, page=None):
else:
search_extras[param] = value

fq += ' capacity:"public"'
context = {'model': model, 'session': model.Session,
'user': c.user or c.author, 'for_view': True}

Expand Down
5 changes: 4 additions & 1 deletion ckanext/organizations/templates/organization_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
>
<?python
import ckan.model as model
editors = c.group.members_of_type(model.User, 'editor')
if isinstance(c.group, model.Group):
editors = c.group.members_of_type(model.User, 'editor')
else:
editors = []
?>
<py:match path="minornavigation">
<ul class="nav nav-pills" py:choose="bool(c.group)">
Expand Down

0 comments on commit a8a5317

Please sign in to comment.