@xuda.io/account_module 1.2.1202 → 1.2.1204

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +5 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1746,6 +1746,11 @@ export const archive_contact = async function (req) {
1746
1746
  await team_module.validate_share_exist(uid, 'contact', contact_id);
1747
1747
 
1748
1748
  var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', contact_id);
1749
+
1750
+ if (contact_doc.uid !== uid && contact_doc?.account_profile_info?.uid !== uid) {
1751
+ throw new Error('Operation not allowed');
1752
+ }
1753
+
1749
1754
  contact_doc.stat = 5;
1750
1755
  contact_doc.stat_ts = Date.now();
1751
1756
  contact_doc.stat_reason = 'archived by the user';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1202",
3
+ "version": "1.2.1204",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {