From 808ae9bd2522f37a181602455cd12d04abdb181e Mon Sep 17 00:00:00 2001 From: Logan Hanks Date: Fri, 14 Sep 2012 13:31:12 -0700 Subject: [PATCH] Add "subscribe" oauth2 scope. --- r2/r2/controllers/api.py | 1 + r2/r2/models/token.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 6a6150cc3..a4504aedb 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -2094,6 +2094,7 @@ class ApiController(RedditController, OAuth2ResourceController): c.user._commit() + @require_oauth2_scope("subscribe") @noresponse(VUser(), VModhash(), action = VOneOf('action', ('sub', 'unsub')), diff --git a/r2/r2/models/token.py b/r2/r2/models/token.py index 34728a271..1b5c34914 100644 --- a/r2/r2/models/token.py +++ b/r2/r2/models/token.py @@ -108,7 +108,7 @@ class OAuth2Scope: }, "mysubreddits": { "id": "mysubreddits", - "name": _("My Subscriptions"), + "name": _("My Subreddits"), "description": _( "Access the list of subreddits I moderate, contribute to," " and subscribe to."), @@ -118,6 +118,11 @@ class OAuth2Scope: "name": _("Submit Content"), "description": _("Submit links and comments from my account."), }, + "subscribe": { + "id": "subscribe", + "name": _("Edit My Subscriptions"), + "description": _("Manage my subreddit subscriptions."), + }, } def __init__(self, scope_str=None):