mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 14:58:27 -05:00
Add "edit" oauth2 scope.
This commit is contained in:
@@ -797,6 +797,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
c.user.delete(delete_message)
|
||||
form.redirect("/?deleted=true")
|
||||
|
||||
@require_oauth2_scope("edit")
|
||||
@noresponse(VUser(),
|
||||
VModhash(),
|
||||
thing = VByNameIfAuthor('id'))
|
||||
@@ -946,6 +947,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
|
||||
indict(thing)
|
||||
|
||||
@require_oauth2_scope("edit")
|
||||
@validatedForm(VUser(),
|
||||
VModhash(),
|
||||
item = VByNameIfAuthor('thing_id'),
|
||||
|
||||
@@ -96,6 +96,11 @@ class ConsumableToken(Token):
|
||||
|
||||
class OAuth2Scope:
|
||||
scope_info = {
|
||||
"edit": {
|
||||
"id": "edit",
|
||||
"name": _("Edit Posts"),
|
||||
"description": _("Edit and delete my comments and submissions."),
|
||||
},
|
||||
"identity": {
|
||||
"id": "identity",
|
||||
"name": _("My Identity"),
|
||||
|
||||
Reference in New Issue
Block a user