ConsentResource to gather policy consent from users

Hopefully there are enough comments and docs in this that it makes sense on its
own.
This commit is contained in:
Richard van der Hoff 2018-05-11 00:17:11 +01:00
parent bd8d0cfab1
commit 47815edcfa
14 changed files with 446 additions and 5 deletions

View file

@ -286,6 +286,24 @@ class RegistrationStore(RegistrationWorkerStore,
"user_set_password_hash", user_set_password_hash_txn
)
def user_set_consent_version(self, user_id, consent_version):
"""Updates the user table to record privacy policy consent
Args:
user_id (str): full mxid of the user to update
consent_version (str): version of the policy the user has consented
to
Raises:
StoreError(404) if user not found
"""
return self._simple_update_one(
table='users',
keyvalues={'name': user_id, },
updatevalues={'consent_version': consent_version, },
desc="user_set_consent_version"
)
def user_delete_access_tokens(self, user_id, except_token_id=None,
device_id=None):
"""