summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/opendc/api/v2/prefabs
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-api/opendc/api/v2/prefabs')
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/prefabs/authorizations/endpoint.py2
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/prefabs/endpoint.py2
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/prefabs/prefabId/endpoint.py6
3 files changed, 5 insertions, 5 deletions
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/prefabs/authorizations/endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/prefabs/authorizations/endpoint.py
index 0d9ad5cd..0de50851 100644
--- a/opendc-web/opendc-web-api/opendc/api/v2/prefabs/authorizations/endpoint.py
+++ b/opendc-web/opendc-web-api/opendc/api/v2/prefabs/authorizations/endpoint.py
@@ -7,7 +7,7 @@ from opendc.util.rest import Response
def GET(request):
"""Return all prefabs the user is authorized to access"""
- user = User.from_google_id(request.google_id)
+ user = User.from_google_id(request.current_user['sub'])
user.check_exists()
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/prefabs/endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/prefabs/endpoint.py
index 723a2f0d..e77c7150 100644
--- a/opendc-web/opendc-web-api/opendc/api/v2/prefabs/endpoint.py
+++ b/opendc-web/opendc-web-api/opendc/api/v2/prefabs/endpoint.py
@@ -15,7 +15,7 @@ def POST(request):
prefab.set_property('datetimeCreated', Database.datetime_to_string(datetime.now()))
prefab.set_property('datetimeLastEdited', Database.datetime_to_string(datetime.now()))
- user = User.from_google_id(request.google_id)
+ user = User.from_google_id(request.current_user['sub'])
prefab.set_property('authorId', user.get_id())
prefab.insert()
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/prefabs/prefabId/endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/prefabs/prefabId/endpoint.py
index 7b81f546..f1cf1fcd 100644
--- a/opendc-web/opendc-web-api/opendc/api/v2/prefabs/prefabId/endpoint.py
+++ b/opendc-web/opendc-web-api/opendc/api/v2/prefabs/prefabId/endpoint.py
@@ -12,7 +12,7 @@ def GET(request):
prefab = Prefab.from_id(request.params_path['prefabId'])
prefab.check_exists()
- prefab.check_user_access(request.google_id)
+ prefab.check_user_access(request.current_user['sub'])
return Response(200, 'Successfully retrieved prefab', prefab.obj)
@@ -25,7 +25,7 @@ def PUT(request):
prefab = Prefab.from_id(request.params_path['prefabId'])
prefab.check_exists()
- prefab.check_user_access(request.google_id)
+ prefab.check_user_access(request.current_user['sub'])
prefab.set_property('name', request.params_body['prefab']['name'])
prefab.set_property('rack', request.params_body['prefab']['rack'])
@@ -43,7 +43,7 @@ def DELETE(request):
prefab = Prefab.from_id(request.params_path['prefabId'])
prefab.check_exists()
- prefab.check_user_access(request.google_id)
+ prefab.check_user_access(request.current_user['sub'])
old_object = prefab.delete()