diff options
-rw-r--r-- | src/web/views/api/v3/article.py | 2 | ||||
-rw-r--r-- | src/web/views/api/v3/common.py | 2 | ||||
-rw-r--r-- | src/web/views/api/v3/feed.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/web/views/api/v3/article.py b/src/web/views/api/v3/article.py index 44c5fe45..49a9842e 100644 --- a/src/web/views/api/v3/article.py +++ b/src/web/views/api/v3/article.py @@ -13,7 +13,7 @@ class ArticleProcessor(AbstractProcessor): # instance of the model. contr = ArticleController(current_user.id) article = contr.get(id=instance_id) - if not self.is_authorized_to_modify(current_user, article): + if not self.is_authorized(current_user, article): raise ProcessingException(description='Not Authorized', code=401) def post_put_preprocessor(self, data=None, **kw): diff --git a/src/web/views/api/v3/common.py b/src/web/views/api/v3/common.py index f0dd45ab..bd20ad38 100644 --- a/src/web/views/api/v3/common.py +++ b/src/web/views/api/v3/common.py @@ -26,7 +26,7 @@ def auth_func(*args, **kw): class AbstractProcessor(): - def is_authorized_to_modify(self, user, obj): + def is_authorized(self, user, obj): return user.id == obj.user_id def get_single_preprocessor(self, instance_id=None, **kw): diff --git a/src/web/views/api/v3/feed.py b/src/web/views/api/v3/feed.py index ef1b415f..a97aa415 100644 --- a/src/web/views/api/v3/feed.py +++ b/src/web/views/api/v3/feed.py @@ -11,7 +11,7 @@ class FeedProcessor(AbstractProcessor): # instance of the model. contr = FeedController(current_user.id) feed = contr.get(id=instance_id) - if not self.is_authorized_to_modify(current_user, feed): + if not self.is_authorized(current_user, feed): raise ProcessingException(description='Not Authorized', code=401) |