mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
OAuth2: Add 'report' scope (works for 'hide' too)
This commit is contained in:
@@ -1245,6 +1245,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
sr._commit()
|
||||
jquery.refresh()
|
||||
|
||||
@require_oauth2_scope("report")
|
||||
@noresponse(VUser(), VModhash(),
|
||||
thing = VByName('id'))
|
||||
@api_doc(api_section.links_and_comments)
|
||||
@@ -2491,6 +2492,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
def POST_read_message(self, things):
|
||||
self.unread_handler(things, False)
|
||||
|
||||
@require_oauth2_scope("report")
|
||||
@noresponse(VUser(),
|
||||
VModhash(),
|
||||
thing = VByName('id', thing_cls=Link))
|
||||
@@ -2506,6 +2508,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
if not thing: return
|
||||
thing._hide(c.user)
|
||||
|
||||
@require_oauth2_scope("report")
|
||||
@noresponse(VUser(),
|
||||
VModhash(),
|
||||
thing = VByName('id'))
|
||||
|
||||
@@ -173,6 +173,12 @@ class OAuth2Scope:
|
||||
"name": _("Read Content"),
|
||||
"description": _("Access posts and comments through my account."),
|
||||
},
|
||||
"report": {
|
||||
"id": "report",
|
||||
"name": _("Report content"),
|
||||
"description": _("Report content for rules violations. "
|
||||
"Hide & show individual submissions."),
|
||||
},
|
||||
"save": {
|
||||
"id": "save",
|
||||
"name": _("Save Content"),
|
||||
|
||||
Reference in New Issue
Block a user