diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 64027c456..1b09e70d5 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -1675,11 +1675,11 @@ class ApiController(RedditController, OAuth2ResourceController): @require_oauth2_scope("modposts") @noresponse(VUser(), VModhash(), - why = VSrCanBan('id'), + VSrCanBan('id'), thing = VByName('id'), spam = VBoolean('spam', default=True)) @api_doc(api_section.moderation) - def POST_remove(self, why, thing, spam): + def POST_remove(self, thing, spam): # Don't remove a promoted link if getattr(thing, "promoted", None): @@ -1714,10 +1714,10 @@ class ApiController(RedditController, OAuth2ResourceController): @require_oauth2_scope("modposts") @noresponse(VUser(), VModhash(), - why = VSrCanBan('id'), + VSrCanBan('id'), thing = VByName('id')) @api_doc(api_section.moderation) - def POST_approve(self, why, thing): + def POST_approve(self, thing): if not thing: return if thing._deleted: return kw = {'target': thing} diff --git a/r2/r2/controllers/validator/validator.py b/r2/r2/controllers/validator/validator.py index 66b4cc401..de306f48b 100644 --- a/r2/r2/controllers/validator/validator.py +++ b/r2/r2/controllers/validator/validator.py @@ -832,7 +832,7 @@ class VSrCanAlter(VByName): class VSrCanBan(VByName): def run(self, thing_name): if c.user_is_admin: - return 'admin' + return True elif c.user_is_loggedin: item = VByName.run(self, thing_name) # will throw a legitimate 500 if this isn't a link or @@ -840,9 +840,7 @@ class VSrCanBan(VByName): # comments subreddit = item.subreddit_slow if subreddit.is_moderator(c.user): - return 'mod' - # elif subreddit.is_contributor(c.user): - # return 'contributor' + return True abort(403,'forbidden') class VSrSpecial(VByName):