GPDR compliance: require 2FA to see other people's data

This commit is contained in:
Rick Falkvinge
2018-04-09 22:23:59 +02:00
parent a757c6e3a3
commit 67e92cced1
3 changed files with 32 additions and 0 deletions
@@ -9,6 +9,7 @@ x NEW FEATURES
x IMPROVEMENTS
- GPDR compliance: A person must now have 2FA enabled to see other people's data
- (IN PROGRESS) Changed bank file reader to use CSV helper
+21
View File
@@ -354,6 +354,16 @@ namespace Swarmops.Logic.Security
public People FilterPeople(People rawList, AccessAspect aspect = AccessAspect.Participation)
{
if (!this.Person.TwoFactorEnabled)
{
if (this.Organization.Identity != Organization.SandboxIdentity)
{
// GPDR compliance: to see any personal data, require 2FA to be turned on
return new People();
}
}
if (aspect != AccessAspect.Participation && aspect != AccessAspect.PersonalData)
{
throw new ArgumentException(@"AccessAspect needs to reflect visibility of people data", "aspect");
@@ -524,6 +534,17 @@ namespace Swarmops.Logic.Security
throw new ArgumentException(@"AccessAspect needs to reflect visibility of people data", "aspect");
}
if (!this.Person.TwoFactorEnabled)
{
if (this.Organization.Identity != Organization.SandboxIdentity)
{
// GPDR compliance: to see any personal data, require 2FA to be turned on
return false;
}
}
// Three cases:
// 1) the current Position has system-level access.
+10
View File
@@ -269,6 +269,16 @@ namespace Swarmops.Logic.Swarm
set { OptionalData.SetOptionalDataString (ObjectOptionalDataType.BitIdLoginAddress, value); }
}
public virtual bool BitIdEnabled
{
get { return !string.IsNullOrEmpty(BitIdAddress); }
}
public virtual bool TwoFactorEnabled
{
get { return BitIdEnabled; }
}
public virtual bool MailUnreachable
{