Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
share emails: Prohibit sharing posts the user cannot view.
Browse files Browse the repository at this point in the history
Thanks to a report by Jordan Milne (/u/largenocream).
  • Loading branch information
chromakode committed Mar 1, 2014
1 parent 2a285f8 commit 959240a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions r2/r2/controllers/api.py
Expand Up @@ -1534,6 +1534,8 @@ def POST_share(self, shareform, jquery, emails, thing, share_from, reply_to,
pass
elif shareform.has_errors("ratelimit", errors.RATELIMIT):
pass
elif not sr.can_view(c.user):
return abort(403, 'forbidden')
else:
emails, users = emails
c.user.add_share_emails(emails)
Expand Down

0 comments on commit 959240a

Please sign in to comment.