From 9c18b5cc9f07154fe0167ba78d45b739f8890c3c Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 4 Nov 2015 12:57:36 +0100 Subject: [PATCH] Added project property for files This property can be combined to the backend for locating the file within the backed. Originally introduced to support Google Cloud Storage (where every project is store in its own bucket, named after the project id). --- pillar/settings.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pillar/settings.py b/pillar/settings.py index ab18e0a1..f6362ee4 100644 --- a/pillar/settings.py +++ b/pillar/settings.py @@ -388,13 +388,25 @@ files_schema = { 'backend': { 'type': 'string', 'required': True, - 'allowed': ["attract-web", "pillar", "cdnsun"] + 'allowed': ["attract-web", "pillar", "cdnsun", "gcs"] }, 'path': { 'type': 'string', #'required': True, 'unique': True, }, + 'project': { + # The project node the files belongs to (does not matter if it is + # attached to an asset or something else). We use the project id as + # top level filtering, folder or bucket name. Later on we will be able + # to join permissions from the project and verify user access. + 'type': 'objectid', + 'data_relation': { + 'resource': 'nodes', + 'field': '_id', + 'embeddable': True + }, + }, 'previews': { # Deprecated (see comments above) 'type': 'list', 'schema': {