إضافة أدوات قانونية

المستودع: GitHub - paviliondev/discourse-legal-tools: Tools to help with legal compliance when using Discourse · GitHub

يوفر هذا الملحق أدوات للمساعدة في الامتثال القانوني عند تشغيل منتدى Discourse. سيتم إضافة الأدوات بشكل مستمر.

يرجى ملاحظة إخلاء المسؤولية أدناه. لا يضمن هذا الملحق الامتثال القانوني.

تحميل المستخدم الموسع

تحميل المستخدم الموسع هو ملف CSV واحد يحتوي على المدخلات التالية، مفصولة بسطرين فارغين بين كل منها:

  • رأس (يمكن تعديله: تخصيص > محتوى النص > “csv_export.extended.title”):

    جميع المعلومات الخاصة بـ %{username} التي يخزنها %{site_name}

    • “username” هو اسم مستخدم المستخدم الذي تتضمن معلوماته التحميل.
    • “site_name” هو إعداد الموقع title.
  • ملاحظة أسفل الرأس (يمكن تعديلها: تخصيص > محتوى النص > “csv_export.extended.note”):

    يرجى ملاحظة أن بعض المعلومات المرتبطة بمعرف المستخدم %{username}
    قد تم استبعادها من هذا التحميل بسبب اعتبارات الخصوصية والمصالح القانونية المتعارضة.
    للحصول على مزيد من المعلومات، يرجى الاتصال بـ %{site_contact}.

    • “username” هو اسم مستخدم المستخدم الذي تتضمن معلوماته التحميل.
    • “site_contact” هو إعداد موقع contact email.
  • المنشورات. المعلومات الافتراضية المدرجة في تحميل المستخدم.

  • الحساب. معلومات الحساب والملف الشخصي.

  • الحسابات الخارجية. معلومات من الحسابات الخارجية (إن وجدت).

  • الإحصائيات. المعلومات الإحصائية المخزنة المتعلقة بالمستخدم.

  • تسجيل الدخول وسجل تسجيل الدخول. معلومات حول تسجيلات دخول المستخدم.

  • عمليات البحث. جميع السجلات المسجلة عناوين IP لعمليات البحث التي أجراها المستخدم.

  • مشاهدات المواضيع. جميع مشاهدات المواضيع المسجلة عناوين IP من قبل المستخدم.

  • نقرات روابط المواضيع. جميع روابط المواضيع التي نقر عليها المستخدم والمسجلة عناوين IP.

  • مشاهدات الملف الشخصي. جميع مشاهدات الملف الشخصي المسجلة عناوين IP من قبل المستخدم.

  • الإجراءات. جميع الإجراءات التي اتخذها المستخدم.

  • السجل. جميع السجلات المسجلة عناوين IP للإجراءات القابلة للتسجيل والتي تتضمن المستخدم.

يوجد إعدادان للموقع تمكّنان التحميل الموسع:

  • legal extended user download: عند التمكين، تتحول ميزة “تحميل الكل” في صفحة نشاط المستخدم إلى تحميل موسع.

    • يرجى ملاحظة أنه، مثل تحميل المستخدم العادي، لا يمكن إجراء تحميل المستخدم الموسع إلا مرة واحدة يوميًا من قبل المستخدم.
  • legal extended user download admin. عند التمكين، يمكن للموظفين المخولين تحميل جميع معلومات أي مستخدم في الموقع. سيظهر لهم زر جديد “تحميل الكل” في أعلى معلومات مستخدم كل مستخدم في لوحة الإدارة.

    Screenshot%20at%20May%2026%2014-55-03

    الخيارات:

    • معطل (افتراضي)
    • المسؤولون فقط (يمكن للمسؤولين فقط استخدام ميزة التحميل الموسع للإدارة)
    • المسؤولون والموظفون (يمكن للمسؤولين والموظفين استخدام ميزة التحميل الموسع للإدارة)

الإعدادان قابلان للفصل، أي يمكنك تمكين legal extended user download دون منح المسؤولين أو الموظفين القدرة على تحميل جميع معلومات كل مستخدم، أو يمكنك تمكين legal extended user download admin دون منح المستخدمين القدرة على تحميل جميع معلوماتهم.

الخلفية لهذه الميزة هي اللائحة العامة لحماية البيانات (GDPR) في الاتحاد الأوروبي. راجع على وجه الخصوص:

يرجى ملاحظة أنه يجب عليك النظر في الآثار الأمنية للسماح للمستخدمين والموظفين و/أو المسؤولين بالقدرة على تحميل جميع المعلومات المدرجة. قد لا تكون هذه الميزة مناسبة في جميع الظروف. يمكن العثور على معلومات إضافية حول هذه القضية في المواضيع المذكورة أعلاه.

البديل المباشر لتحميل معلومات المستخدم هو أن يقوم موظف معني (وهو “موظف حماية البيانات”) بتجميع المعلومات عبر استعلامات قاعدة البيانات.

إخلاء المسؤولية

إن ملحق الأدوات القانونية (المشار إليه بـ “الملحق”) ومؤلفه أنغوس ماكليود (المشار إليه بـ “المؤلف”) ليسوا محامين ولا بديلًا عن محامٍ أو مشورة قانونية. لا تتمتع الاتصالات بينك وبين المؤلف بحماية امتياز المحامي-الموكل أو كعمل محمي. لا يمكن للملحق ولا لمؤلفه تقديم أي نوع من المشورة أو التفسير أو الرأي أو التوصية أو الضمان بشأن الحقوق القانونية المحتملة أو سبل الانتصاف أو الدفاعات أو الخيارات أو اختيار النماذج أو الاستراتيجيات.

62 إعجابًا

@codinghorror how much of this do you think belongs in core? Should we just amend our default “download all my data” to include all this stuff?

9 إعجابات

No, we need @riking to come through with the removal of IP where it’s unnecessarily recorded and should not be first. If that can’t be achieved in a reasonable timeframe we need to get someone else to do it.

5 إعجابات

Update here.

Scope of the download

All user-related records in user activity (record of likes, bookmarks, topics, replies etc) have been added to the download (commit).

I initially didn’t add this as it seemed like overkill. However @RGJ raised it with me and we had a productive exchange on the question.

Essentially, we decided that the best approach for the purposes of this feature was to include all records of activity tied to the user’s identifier that don’t entail countervailing concerns about the privacy of others or similar rights.

I would emphasise “for the purposes of this feature”, as the purpose of this feature is to take a ‘maximalist’ approach to possible interpretations of the GDPR. It does not attempt to parse ‘likely’ approaches. I’ve laid out some of my own views on the ‘likely’ approaches in this topic (which remain unchanged).

The specifics of the reasoning behind this ‘maximalist’ approach are:

  • The broadest interpretation of A.4.1 (the definition of ‘Personal Data’ in the GDPR) as it applies to Discourse is any record in the db that contains the user’s user_id, i.e.:

    any information … identified or identifiable natural person … identified, directly or indirectly, in particular by reference to … an identification number

  • Read literally, this definition doesn’t care about how the data is produced (e.g. whether the user is acting or not). It merely requires the data to be related to the user’s identifier in some way.

  • However, applying that literally would produce a fair amount of duplication (e.g. the records in the directory_items table are duplicative of various other entries).

  • The point of the extended download is to guard against even the small risk that Article 4.1 could receive a very broad interpretation by some authority or court in Europe.

  • The factors against including it - size of download, potentially security (?) - do not outweigh the possible benefit of including it.

We also considered whether to include ‘administrative’ records with the user’s user_id such as flags, complaints and staff whispers. We decided against this, reasoning as follows:

  • They’re already in the territory of information associated with the user purely by their identifier. They are not information about the user per se (i.e. name, email, age, location etc). This is already assuming a wide interpretation of A.4.1.

  • Whether administrative records intrude on the privacy of other parties, or other relevant concerns (i.e. R. 63.5 & A.15.4) must be determined on a case-by-case basis.

  • Other parties, such as Facebook, do no include such data in their user download functionality.

12 إعجابًا

Hey Angus,

I’m having some trouble getting this to work. I’ve enabled the ‘legal extended user download’ setting, refreshed the page and clicked the ‘Download all’ button on the activity page. This results in an archive that contains one CSV file with topics in it. I checked both as an admin and as a regular user. What is the expected output - multiple CSV files, each for a different table?

The expected output is a single csv with headers for each item mentioned in the first post in this topic. If you try it out on my sandbox, this is what you’ll get.

Do you see any errors at /sidekiq?

@RGJ have you had this issue?

Nope. We had a few users with the same kind of complaint though but it turned out to be a false alarm.
I guess they never scrolled down past the posts. Maybe it’s an idea to move the posts section (i.e. the most unstructured / multiline content) to be the last section.

إعجاب واحد (1)

Could you provide a few of the header rows as an example so I can do a search for them?

See the ‘separator’ lines here.

Thanks Richard. Definitely not seeing those. So just to be sure I’m doing the right thing: this plugin is supposed to replace the ‘Download’ button in the Profile > Activity sidebar, right?

First words of admiration go to @angus :clap: :heart: :+1: for doing such a great job helping everyone here to get those highly useful tools (not only this plugin but other plugins too).

I’ve got one question though: wouldn’t it be better to have this export available to admins only (at least as option for those concerned)?
Isn’t it potentially risky in case when given account password is compromised and then ‘all activity’ is easily downloaded by unauthorized person? (Sorry that is two questions :slight_smile: )

3 إعجابات

I just did a few more tests and tried it on your sandbox too. My results are just the default download - they don’t match your new format. I don’t think I see any errors in sidekiq (at least not in ‘Failed’ - ‘Errors’ is not clickable). Any suggestions how I can best find more information here?

Please post (or PM) a screenshot of the csv you got from my sandbox with the ip addresses blacked out (if any).

I think I’ll make this a setting.

Potentially. This is partly what I meant by

Nevertheless, some people will need / want the functionality of allowing users to directly download their info. So I think a setting is the move here.

إعجاب واحد (1)

There are now two site settings that enable the extended download:

  • legal extended user download: When enabled, the “Download All” feature in the User Activity page becomes an extended download.

    • Please note that, like the normal user download, the extended user download can only be performed by a user once a day.
  • legal extended user download admin. When enabled, permitted staff can download all the information of any user of the site. They will see an new “Download All” button at the top of the the admin user information of each user.

    Screenshot%20at%20May%2026%2014-55-03

    Options:

    • Disabled (default)
    • Admins Only (only admins can use the admin extended download feature)
    • Admins and Staff (both admins and staff can use the admin extended download feature)

The two settings are severable, i.e. you can enable legal extended user download without giving admins or staff the ability to download all the information of every user, or you can enable legal extended user download admin without giving users the ability to download all of their information.

Due to the security implications of allowing users (even if they’re admins) to download all the information of other users, I’ve been particularly careful with protecting the admin extended user download server methods, however I would appreciate a second set of eyes on that aspect of the changes, particularly considering this feature seems to be quite popular. Perhaps you could take a look @riking if you have the time? (i.e. particularly the changes to the Guardian).

I’ve also added text to the top of the extended csv:

  • A header (can be edited: Customize > Text Content > “csv_export.extended.title”):

    All information of %{username} stored by %{site_name}

    • “username” is the username of the user who’s information is in the download.
    • “site_name” is the title site setting.
  • A note below the header (can be edited: Customize > Text Content > “csv_export.extended.note”):

    Please note that some information associated with the user identifier of %{username}
    has been excluded from this download due to countervailing privacy and legal interests.
    For more information, please contact %{site_contact}.

    • “username” is the username of the user who’s information is in the download.
    • “site_contact” is the contact email site setting.

This has all been tested on my sandbox where it is currently live.

@bartv Let me know if these updates fix your issue.

8 إعجابات

This new version solves the issue I had before. Thanks for all your hard work on this, Angus!

The extended note is interesting; could you shed some light on which information has been excluded and for which reasons?

3 إعجابات

That is primarily referring to the exclusion mentioned below, and also helps if we’ve not included something some authority happens to consider relevant.

4 إعجابات

تم تقسيم 6 منشورات إلى موضوع جديد: فشل تصدير بيانات المستخدم (تم إلغاء المعاملة)

بصفتي مديرًا، جربت للتو تصدير بيانات مستخدم (طلب GDPR) بالنقر على الزر الصحيح (تحميل الكل)، لكنني تلقيت رسالة من النظام تفيد بأن تصدير البيانات فشل وعليّ التحقق من السجلات.

لا أستطيع تحديد ما إذا كانت هذه مشكلة داخل الإضافة أم مشكلة في Discourse نفسه.
تحديث 11 يناير 17:40 توقيت عالمي منسق: قال فريق Discourse للتو إن النظر في تتبع الأخطاء يشير إلى أن المشكلة في إضافة تابعة لطرف ثالث. @angus هل يمكنك الرجاء النظر في هذا، شكرًا لك.

مثيل Discourse يعمل على الإصدار 2.7.0.beta1 (4f72830eb0)
تحديث 11 يناير 16:15 توقيت عالمي منسق: الآن على الإصدار 2.7.0.beta1 (422f395042) لكن الخطأ لا يزال كما هو.

هذا ما تم تكوينه داخل الإضافة:

في السجلات، أرى الخطأ التالي:
استثناء المهمة: لا توجد طريقة collect لـ nil:NilClass

/usr/local/lib/ruby/2.7.0/csv/writer.rb:46:in `<<'
/usr/local/lib/ruby/2.7.0/csv.rb:1230:in `<<'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:66:in `block (3 levels) in execute'
/var/www/discourse/plugins/discourse-legal-tools/lib/export_csv_file_extension.rb:267:in `user_archive_export_extended'
/var/www/discourse/plugins/discourse-legal-tools/lib/export_csv_file_extension.rb:226:in `admin_user_archive_export'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:66:in `each'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:66:in `block (2 levels) in execute'
/usr/local/lib/ruby/2.7.0/csv.rb:658:in `open'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:64:in `block in execute'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:63:in `each'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:63:in `execute'
/var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'
rails_multisite-2.5.0/lib/rails_multisite/connection_management.rb:76:in `with_connection'
/var/www/discourse/app/jobs/base.rb:221:in `block in perform'
/var/www/discourse/app/jobs/base.rb:217:in `each'
/var/www/discourse/app/jobs/base.rb:217:in `perform'
sidekiq-6.1.2/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq-6.1.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:138:in `call'
sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq-6.1.2/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq-6.1.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/job_retry.rb:111:in `local'
sidekiq-6.1.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq.rb:38:in `block in <module:Sidekiq>'
sidekiq-6.1.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/processor.rb:257:in `stats'
sidekiq-6.1.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq-6.1.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/job_retry.rb:78:in `global'
sidekiq-6.1.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq-6.1.2/lib/sidekiq/logger.rb:10:in `with'
sidekiq-6.1.2/lib/sidekiq/job_logger.rb:33:in `prepare'
sidekiq-6.1.2/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq-6.1.2/lib/sidekiq/processor.rb:162:in `process'
sidekiq-6.1.2/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq-6.1.2/lib/sidekiq/processor.rb:68:in `run'
sidekiq-6.1.2/lib/sidekiq/util.rb:15:in `watchdog'
sidekiq-6.1.2/lib/sidekiq/util.rb:24:in `block in safe_thread'
إعجاب واحد (1)

نعتذر عن التأخير في الرد، لقد كنت خارجًا :beach_umbrella:.

تمكّنت من إعادة إنتاج المشكلة وإصلاحها. يُرجى التحديث والمحاولة مرة أخرى لتحميل الملف. إذا أمكن، أبلغنا عن نتيجة الطلب.

6 إعجابات

لا مشكلة، لقد كان عطلة نهاية أسبوع ولا يجب أن يرد أحد فورًا.
أنا ممتن لهذا الإضافة.

لقد قمت بالتحديث وحاولت مرة أخرى.
عمل كل شيء بشكل جيد، شكرًا جزيلاً على الإصلاح، نقدر حقًا عملك الجيد.

إذا أردت تضمين سجلات “إدارية” أيضًا مع user_id للمستخدم مثل الأعلام والشكاوى والرسائل الخاصة للموظفين، فما هي أفضل جمل SQL للحصول على البيانات باستخدام مستكشف البيانات؟
إذا لزم الأمر، يمكنني بعد ذلك توفير هذه البيانات بشكل منفصل للمستخدم الذي طلبها.

3 إعجابات