Remove links from returned file docs when user is not subscriber/demo/admin.

For unauthenticated/non-subscriber users, image file documents retain
their variations. All other documents have ther variations stripped.
Also the links + expiry info to the original file are removed for all
file types.
This commit is contained in:
2016-05-10 12:35:21 +02:00
parent 62817eec40
commit 9362f9b539
5 changed files with 144 additions and 6 deletions

View File

@@ -79,6 +79,8 @@ class AbstractPillarTest(TestMinimal):
file = copy.deepcopy(EXAMPLE_FILE)
if file_overrides is not None:
file.update(file_overrides)
if '_id' in file and file['_id'] is None:
del file['_id']
result = files_collection.insert_one(file)
file_id = result.inserted_id