Skip to content

Commit

Permalink
use user can edit criteria instead of user is owner critera. See http…
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Raney authored and Austin Raney committed Sep 27, 2021
1 parent e3a178d commit b24785e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hydroshare_jupyter_sync/lib/filesystem/fs_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def create_map(
username = hydroshare._hs_session._session.auth[0]

# NOTE: assumes only resources desired for tracking are owned. may not be desirable.
# get user owned resources
# get resources the user can edit
remote_resources = {
res.resource_id for res in hydroshare.search(owner=username)
res.resource_id for res in hydroshare.search(edit_permission=True)
}
# naively get local resources based on fs_root location and directory name length
naive_local_resources = set(fs_map._get_resource_ids())
Expand Down
4 changes: 2 additions & 2 deletions hydroshare_jupyter_sync/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,15 @@ def get(self, res_id):


class ListUserHydroShareResources(HeadersMixIn, BaseRequestHandler):
"""List the HydroShare resources a user is an owner of."""
"""List the HydroShare resources a user has edit permission of."""

_custom_headers = [("Access-Control-Allow-Methods", "GET")]

def get(self):
session = self.get_session()
username = session.username

resources = list(session.session.search(owner=username))
resources = list(session.session.search(edit_permission=True))

# Marshall hsclient representation into CollectionOfResourceMetadata
self.write(CollectionOfResourceMetadata.parse_obj(resources).json())
Expand Down

0 comments on commit b24785e

Please sign in to comment.