summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/opendc/exts.py
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-07 20:45:06 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-08 10:53:25 +0200
commit5ec19973eb3d23046d874b097275857a58c23082 (patch)
treea601cd975f8917fb2d4af28e8a3fb228e0cb769e /opendc-web/opendc-web-api/opendc/exts.py
parent02a2f0f89cb1f39a5f8856bca1971a4e1b12374f (diff)
api: Add endpoints for accessing project relations
This change adds additional endpoints to the REST API to access the project relations, the portfolios and topologies that belong to a project.
Diffstat (limited to 'opendc-web/opendc-web-api/opendc/exts.py')
-rw-r--r--opendc-web/opendc-web-api/opendc/exts.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/opendc-web/opendc-web-api/opendc/exts.py b/opendc-web/opendc-web-api/opendc/exts.py
index 17dacd5e..3ee8babb 100644
--- a/opendc-web/opendc-web-api/opendc/exts.py
+++ b/opendc-web/opendc-web-api/opendc/exts.py
@@ -83,10 +83,9 @@ def requires_scope(required_scope):
@wraps(f)
def decorated(*args, **kwargs):
if not has_scope(required_scope):
- raise AuthError({
- "code": "Unauthorized",
- "description": "You don't have access to this resource"
- }, 403)
+ raise AuthError({"code": "Unauthorized", "description": "You don't have access to this resource"}, 403)
return f(*args, **kwargs)
+
return decorated
+
return decorator