Add "modposts" oauth2 scope.

This commit is contained in:
Logan Hanks
2012-09-18 15:47:09 -07:00
parent 2226cae098
commit 0dc3405b24
2 changed files with 12 additions and 0 deletions

View File

@@ -843,6 +843,7 @@ class ApiController(RedditController, OAuth2ResourceController):
queries.delete(thing)
@require_oauth2_scope("modposts")
@noresponse(VUser(),
VModhash(),
VSrCanAlter('id'),
@@ -859,6 +860,7 @@ class ApiController(RedditController, OAuth2ResourceController):
# flag search indexer that something has changed
changed(thing)
@require_oauth2_scope("modposts")
@noresponse(VUser(),
VModhash(),
VSrCanAlter('id'),
@@ -1631,6 +1633,7 @@ class ApiController(RedditController, OAuth2ResourceController):
d['approval'] = approval
g.hardcache.set(key, d, time=86400 * 7)
@require_oauth2_scope("modposts")
@noresponse(VUser(), VModhash(),
why = VSrCanBan('id'),
thing = VByName('id'),
@@ -1671,6 +1674,7 @@ class ApiController(RedditController, OAuth2ResourceController):
action = 'remove' + thing.__class__.__name__.lower()
ModAction.create(sr, c.user, action, **kw)
@require_oauth2_scope("modposts")
@noresponse(VUser(), VModhash(),
why = VSrCanBan('id'),
thing = VByName('id'))
@@ -1697,6 +1701,7 @@ class ApiController(RedditController, OAuth2ResourceController):
action = 'approve' + thing.__class__.__name__.lower()
ModAction.create(sr, c.user, action, **kw)
@require_oauth2_scope("modposts")
@validatedForm(VUser(), VModhash(),
VCanDistinguish(('id', 'how')),
thing = VByName('id'),

View File

@@ -107,6 +107,13 @@ class OAuth2Scope:
"description": _(
"Manage and assign flair in subreddits I moderate."),
},
"modposts": {
"id": "modposts",
"name": _("Moderate Posts"),
"description": _(
"Approve, remove, mark nsfw, and distinguish content"
" in subreddits I moderate."),
},
"modtraffic": {
"id": "modtraffic",
"name": _("Subreddit Traffic"),