diff options
Diffstat (limited to 'web-server/opendc/models/prefab.py')
| -rw-r--r-- | web-server/opendc/models/prefab.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/web-server/opendc/models/prefab.py b/web-server/opendc/models/prefab.py index d3b1a5d5..42c29697 100644 --- a/web-server/opendc/models/prefab.py +++ b/web-server/opendc/models/prefab.py @@ -6,7 +6,7 @@ from opendc.util.rest import Response class Prefab(Model): - """Model representing a Prefab.""" + """Model representing a Project.""" collection_name = 'prefabs' @@ -17,13 +17,12 @@ class Prefab(Model): :param edit_access: True when edit access should be checked, otherwise view access. """ user = User.from_google_id(google_id) - authorizations = list(filter(lambda x: str(x['prefabId']) == str(self.get_id()), - user.obj['authorizations'])) + authorizations = list(filter(lambda x: str(x['prefabId']) == str(self.get_id()), user.obj['authorizations'])) if len(authorizations) == 0 or (edit_access and authorizations[0]['authorizationLevel'] == 'VIEW'): raise ClientError(Response(403, "Forbidden from retrieving prefab.")) def get_all_authorizations(self): - """Get all user IDs having access to this prefab.""" + """Get all user IDs having access to this project.""" return [ str(user['_id']) for user in DB.fetch_all({'authorizations': { 'prefabId': self.obj['_id'] |
