Skip to content
Snippets Groups Projects
Commit 9944e6ae authored by Megan Henning's avatar Megan Henning Committed by GitHub
Browse files

Merge pull request #628 from scitran/archive-add-ons

Minor changes to archived functionality
parents 9c99b85a 65daf4fe
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,6 @@ def default_container(handler, container=None, target_parent_container=None):
)
elif method == 'PUT' and target_parent_container is None:
required_perm = 'rw'
if set(['archived','public']).intersection(payload.keys()):
required_perm = 'admin'
has_access = _get_access(handler.uid, handler.user_site, container) >= INTEGER_ROLES[required_perm]
else:
has_access = False
......
......@@ -140,6 +140,8 @@ class CollectionsHandler(ContainerHandler):
{'$group': {'_id': '$session'}},
])
query = {'_id': {'$in': [ar['_id'] for ar in agg_res]}}
if not self.is_true('archived'):
query['archived'] = {'$ne': True}
projection = self.container_handler_configurations['sessions']['list_projection']
log.debug(query)
log.debug(projection)
......@@ -159,6 +161,8 @@ class CollectionsHandler(ContainerHandler):
if not self.storage.dbc.find_one({'_id': _id}):
self.abort(404, 'no such Collection')
query = {'collections': _id}
if not self.is_true('archived'):
query['archived'] = {'$ne': True}
sid = self.get_param('session', '')
if bson.ObjectId.is_valid(sid):
query['session'] = bson.ObjectId(sid)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment