-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an instance config option for stricter anonymity
There is a view ('all-messages-from-the-same-author-as') which, given a message slug, allows you to list any other messages with the same author email address as the message with that slug. In situations where anonymity is important, this is undesirable - someone might send a sensitive message with a false name and an uncontroversial one with their real name, in which case this view would reveal that they're sent by the same person. This commit introduces a new instance config option ('email_and_name_must_match') which means that the 'all-messages-from-the-same-author-as' view will only show messages that have the same author_email *and* author_name, to avoid this information leak. Fixes mysociety/alpaca#35 Fixes #1194
- Loading branch information
Showing
4 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
instance/migrations/0003_add_name_and_email_match_config_option.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('instance', '0002_writeitinstanceconfig_allow_anonymous_messages'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='writeitinstanceconfig', | ||
name='email_and_name_must_match', | ||
field=models.BooleanField(default=False, help_text='When showing other messages by the same author, the public name must match as well as the hidden email'), | ||
preserve_default=True, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters