Skip to content
Snippets Groups Projects
Commit a59e117b authored by Carlos Correa's avatar Carlos Correa
Browse files

Fix small issues with passing permissions for UID uploader.

parent 4341db07
No related branches found
No related tags found
No related merge requests found
......@@ -350,7 +350,7 @@ def find_existing_hierarchy(metadata, user=None, site=None):
if session_obj is None:
raise APINotFoundException('Session with uid {} does not exist'.format(session_uid))
if user and not has_access(user, session_obj, 'rw'):
if user and not has_access(user, session_obj, 'rw', site):
raise APIPermissionException('User {} does not have read-write access to session {}'.format(user, session_uid))
a = config.db.acquisitions.find_one({'uid': acquisition_uid}, ['_id'])
......@@ -383,7 +383,7 @@ def upsert_bottom_up_hierarchy(metadata, user=None, site=None):
log.error(metadata)
raise APIStorageException(str(e))
session_obj = config.db.sessions.find_one({'uid': session_uid}, ['project'])
session_obj = config.db.sessions.find_one({'uid': session_uid})
if session_obj: # skip project creation, if session exists
if user and not has_access(user, session_obj, 'rw', site):
......@@ -398,7 +398,7 @@ def upsert_bottom_up_hierarchy(metadata, user=None, site=None):
)
return target_containers
else:
return upsert_top_down_hierarchy(metadata, 'uid', user=user, site=None)
return upsert_top_down_hierarchy(metadata, 'uid', user=user, site=site)
def upsert_top_down_hierarchy(metadata, type_='label', user=None, site=None):
......
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