@stamhoofd/backend 2.125.1 → 2.126.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamhoofd/backend",
3
- "version": "2.125.1",
3
+ "version": "2.126.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -57,20 +57,20 @@
57
57
  "@simonbackx/simple-endpoints": "1.21.1",
58
58
  "@simonbackx/simple-errors": "1.5.0",
59
59
  "@simonbackx/simple-logging": "1.0.1",
60
- "@stamhoofd/backend-env": "2.125.1",
61
- "@stamhoofd/backend-i18n": "2.125.1",
62
- "@stamhoofd/backend-middleware": "2.125.1",
63
- "@stamhoofd/crons": "2.125.1",
64
- "@stamhoofd/email": "2.125.1",
65
- "@stamhoofd/excel-writer": "2.125.1",
66
- "@stamhoofd/logging": "2.125.1",
67
- "@stamhoofd/models": "2.125.1",
68
- "@stamhoofd/object-differ": "2.125.1",
69
- "@stamhoofd/queues": "2.125.1",
70
- "@stamhoofd/sql": "2.125.1",
71
- "@stamhoofd/structures": "2.125.1",
72
- "@stamhoofd/types": "2.125.1",
73
- "@stamhoofd/utility": "2.125.1",
60
+ "@stamhoofd/backend-env": "2.126.0",
61
+ "@stamhoofd/backend-i18n": "2.126.0",
62
+ "@stamhoofd/backend-middleware": "2.126.0",
63
+ "@stamhoofd/crons": "2.126.0",
64
+ "@stamhoofd/email": "2.126.0",
65
+ "@stamhoofd/excel-writer": "2.126.0",
66
+ "@stamhoofd/logging": "2.126.0",
67
+ "@stamhoofd/models": "2.126.0",
68
+ "@stamhoofd/object-differ": "2.126.0",
69
+ "@stamhoofd/queues": "2.126.0",
70
+ "@stamhoofd/sql": "2.126.0",
71
+ "@stamhoofd/structures": "2.126.0",
72
+ "@stamhoofd/types": "2.126.0",
73
+ "@stamhoofd/utility": "2.126.0",
74
74
  "archiver": "7.0.1",
75
75
  "axios": "1.16.0",
76
76
  "base-x": "3.0.11",
@@ -91,7 +91,7 @@
91
91
  "stripe": "16.12.0"
92
92
  },
93
93
  "devDependencies": {
94
- "@stamhoofd/test-utils": "2.125.1",
94
+ "@stamhoofd/test-utils": "2.126.0",
95
95
  "@types/cookie": "0.6.0",
96
96
  "@types/luxon": "3.7.1",
97
97
  "@types/mailparser": "3.4.6",
@@ -107,5 +107,5 @@
107
107
  "publishConfig": {
108
108
  "access": "public"
109
109
  },
110
- "gitHead": "7a5fada26c2b7e4d0cd47cd5f2ee95adceae8391"
110
+ "gitHead": "ef959851de9d5f1b31937129fcbdcd9e88662ab7"
111
111
  }
@@ -316,7 +316,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
316
316
  }
317
317
 
318
318
  const maximumStart = 1000 * 60 * 60 * 24 * 31 * 8; // 8 months in advance
319
- if (period.startDate > new Date(Date.now() + maximumStart)) {
319
+ if (period.startDate > new Date(Date.now() + maximumStart) && STAMHOOFD.userMode === 'platform') {
320
320
  throw new SimpleError({
321
321
  code: 'invalid_field',
322
322
  message: 'Period start date is too far in the future',
@@ -326,7 +326,7 @@ export class PatchOrganizationRegistrationPeriodsEndpoint extends Endpoint<Param
326
326
  }
327
327
 
328
328
  // Period has ended
329
- if (STAMHOOFD.environment !== 'development' && period.endDate < new Date()) {
329
+ if (STAMHOOFD.environment !== 'development' && period.endDate < new Date() && STAMHOOFD.userMode === 'platform') {
330
330
  throw new SimpleError({
331
331
  code: 'invalid_field',
332
332
  message: 'Period has ended',
@@ -1199,7 +1199,8 @@ export class AdminPermissionChecker {
1199
1199
  return true;
1200
1200
  }
1201
1201
 
1202
- if (!await this.canAccessMember(member, level)) {
1202
+ // If you can't read the member, you can't have financial access
1203
+ if (!await this.canAccessMember(member, PermissionLevel.Read)) {
1203
1204
  return false;
1204
1205
  }
1205
1206