aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/api/v3/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/views/api/v3/common.py')
-rw-r--r--src/web/views/api/v3/common.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/web/views/api/v3/common.py b/src/web/views/api/v3/common.py
index f5bd2dea..8831b8ba 100644
--- a/src/web/views/api/v3/common.py
+++ b/src/web/views/api/v3/common.py
@@ -1,10 +1,14 @@
from flask.ext.login import current_user
+from flask.ext.restless import ProcessingException
from web.controllers import ArticleController
def is_authorized_to_modify(user, obj):
return user.id == obj.user_id
+def auth_func(*args, **kw):
+ if not current_user.is_authenticated:
+ raise ProcessingException(description='Not authenticated!', code=401)
def check_auth(instance_id=None, **kw):
# Check if the user is authorized to modify the specified
bgstack15