wabe 0.6.12 → 0.6.14

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 (156) hide show
  1. package/dist/database/DatabaseController.d.ts +2 -0
  2. package/dist/file/FileDevAdapter.d.ts +1 -0
  3. package/dist/graphql/pointerAndRelationFunction.d.ts +6 -0
  4. package/dist/index.js +3827 -3541
  5. package/dist/schema/Schema.d.ts +2 -2
  6. package/dist/server/generateCodegen.d.ts +10 -0
  7. package/dist/server/index.d.ts +2 -1
  8. package/dist/utils/objectKeys.d.ts +1 -0
  9. package/package.json +7 -4
  10. package/dev/index.ts +0 -215
  11. package/dist/schema/resolvers/sendEmail.d.ts +0 -1
  12. package/generated/schema.graphql +0 -1945
  13. package/generated/wabe.ts +0 -448
  14. package/src/authentication/OTP.test.ts +0 -69
  15. package/src/authentication/OTP.ts +0 -64
  16. package/src/authentication/Session.test.ts +0 -629
  17. package/src/authentication/Session.ts +0 -517
  18. package/src/authentication/cookies.ts +0 -10
  19. package/src/authentication/defaultAuthentication.ts +0 -209
  20. package/src/authentication/index.ts +0 -4
  21. package/src/authentication/interface.ts +0 -177
  22. package/src/authentication/oauth/GitHub.test.ts +0 -91
  23. package/src/authentication/oauth/GitHub.ts +0 -121
  24. package/src/authentication/oauth/Google.test.ts +0 -91
  25. package/src/authentication/oauth/Google.ts +0 -101
  26. package/src/authentication/oauth/Oauth2Client.test.ts +0 -219
  27. package/src/authentication/oauth/Oauth2Client.ts +0 -135
  28. package/src/authentication/oauth/index.ts +0 -2
  29. package/src/authentication/oauth/utils.test.ts +0 -33
  30. package/src/authentication/oauth/utils.ts +0 -27
  31. package/src/authentication/providers/EmailOTP.test.ts +0 -127
  32. package/src/authentication/providers/EmailOTP.ts +0 -95
  33. package/src/authentication/providers/EmailPassword.test.ts +0 -263
  34. package/src/authentication/providers/EmailPassword.ts +0 -138
  35. package/src/authentication/providers/EmailPasswordSRP.test.ts +0 -208
  36. package/src/authentication/providers/EmailPasswordSRP.ts +0 -191
  37. package/src/authentication/providers/GitHub.ts +0 -24
  38. package/src/authentication/providers/Google.ts +0 -24
  39. package/src/authentication/providers/OAuth.test.ts +0 -185
  40. package/src/authentication/providers/OAuth.ts +0 -106
  41. package/src/authentication/providers/PhonePassword.test.ts +0 -221
  42. package/src/authentication/providers/PhonePassword.ts +0 -136
  43. package/src/authentication/providers/QRCodeOTP.test.ts +0 -77
  44. package/src/authentication/providers/QRCodeOTP.ts +0 -69
  45. package/src/authentication/providers/index.ts +0 -6
  46. package/src/authentication/resolvers/refreshResolver.test.ts +0 -30
  47. package/src/authentication/resolvers/refreshResolver.ts +0 -19
  48. package/src/authentication/resolvers/signInWithResolver.inte.test.ts +0 -59
  49. package/src/authentication/resolvers/signInWithResolver.test.ts +0 -306
  50. package/src/authentication/resolvers/signInWithResolver.ts +0 -106
  51. package/src/authentication/resolvers/signOutResolver.test.ts +0 -38
  52. package/src/authentication/resolvers/signOutResolver.ts +0 -18
  53. package/src/authentication/resolvers/signUpWithResolver.test.ts +0 -180
  54. package/src/authentication/resolvers/signUpWithResolver.ts +0 -68
  55. package/src/authentication/resolvers/verifyChallenge.test.ts +0 -230
  56. package/src/authentication/resolvers/verifyChallenge.ts +0 -78
  57. package/src/authentication/roles.test.ts +0 -49
  58. package/src/authentication/roles.ts +0 -40
  59. package/src/authentication/security.ts +0 -278
  60. package/src/authentication/utils.test.ts +0 -97
  61. package/src/authentication/utils.ts +0 -39
  62. package/src/cache/InMemoryCache.test.ts +0 -62
  63. package/src/cache/InMemoryCache.ts +0 -45
  64. package/src/cron/index.test.ts +0 -17
  65. package/src/cron/index.ts +0 -43
  66. package/src/database/DatabaseController.test.ts +0 -613
  67. package/src/database/DatabaseController.ts +0 -1415
  68. package/src/database/index.test.ts +0 -1551
  69. package/src/database/index.ts +0 -9
  70. package/src/database/interface.ts +0 -308
  71. package/src/email/DevAdapter.ts +0 -7
  72. package/src/email/EmailController.test.ts +0 -29
  73. package/src/email/EmailController.ts +0 -13
  74. package/src/email/index.ts +0 -2
  75. package/src/email/interface.ts +0 -36
  76. package/src/email/templates/sendOtpCode.ts +0 -120
  77. package/src/file/FileController.ts +0 -28
  78. package/src/file/FileDevAdapter.ts +0 -51
  79. package/src/file/hookDeleteFile.ts +0 -25
  80. package/src/file/hookReadFile.ts +0 -66
  81. package/src/file/hookUploadFile.ts +0 -52
  82. package/src/file/index.test.ts +0 -1031
  83. package/src/file/index.ts +0 -2
  84. package/src/file/interface.ts +0 -63
  85. package/src/file/security.ts +0 -156
  86. package/src/graphql/GraphQLSchema.test.ts +0 -5099
  87. package/src/graphql/GraphQLSchema.ts +0 -886
  88. package/src/graphql/index.ts +0 -2
  89. package/src/graphql/parseGraphqlSchema.ts +0 -85
  90. package/src/graphql/parser.test.ts +0 -203
  91. package/src/graphql/parser.ts +0 -707
  92. package/src/graphql/pointerAndRelationFunction.ts +0 -191
  93. package/src/graphql/resolvers.ts +0 -464
  94. package/src/graphql/tests/aggregation.test.ts +0 -1115
  95. package/src/graphql/tests/e2e.test.ts +0 -590
  96. package/src/graphql/tests/scalars.test.ts +0 -250
  97. package/src/graphql/types.ts +0 -227
  98. package/src/hooks/HookObject.test.ts +0 -122
  99. package/src/hooks/HookObject.ts +0 -165
  100. package/src/hooks/authentication.ts +0 -67
  101. package/src/hooks/createUser.test.ts +0 -77
  102. package/src/hooks/createUser.ts +0 -10
  103. package/src/hooks/defaultFields.test.ts +0 -176
  104. package/src/hooks/defaultFields.ts +0 -32
  105. package/src/hooks/deleteSession.test.ts +0 -181
  106. package/src/hooks/deleteSession.ts +0 -20
  107. package/src/hooks/hashFieldHook.test.ts +0 -152
  108. package/src/hooks/hashFieldHook.ts +0 -89
  109. package/src/hooks/index.test.ts +0 -258
  110. package/src/hooks/index.ts +0 -420
  111. package/src/hooks/permissions.test.ts +0 -412
  112. package/src/hooks/permissions.ts +0 -93
  113. package/src/hooks/protected.test.ts +0 -551
  114. package/src/hooks/protected.ts +0 -74
  115. package/src/hooks/searchableFields.test.ts +0 -147
  116. package/src/hooks/searchableFields.ts +0 -86
  117. package/src/hooks/session.test.ts +0 -134
  118. package/src/hooks/session.ts +0 -76
  119. package/src/hooks/setEmail.test.ts +0 -216
  120. package/src/hooks/setEmail.ts +0 -33
  121. package/src/hooks/setupAcl.test.ts +0 -618
  122. package/src/hooks/setupAcl.ts +0 -25
  123. package/src/hooks/virtualFields.test.ts +0 -228
  124. package/src/hooks/virtualFields.ts +0 -48
  125. package/src/index.ts +0 -9
  126. package/src/schema/Schema.test.ts +0 -482
  127. package/src/schema/Schema.ts +0 -839
  128. package/src/schema/defaultResolvers.ts +0 -93
  129. package/src/schema/index.ts +0 -1
  130. package/src/schema/resolvers/meResolver.test.ts +0 -62
  131. package/src/schema/resolvers/meResolver.ts +0 -10
  132. package/src/schema/resolvers/resetPassword.test.ts +0 -341
  133. package/src/schema/resolvers/resetPassword.ts +0 -63
  134. package/src/schema/resolvers/sendEmail.test.ts +0 -118
  135. package/src/schema/resolvers/sendEmail.ts +0 -21
  136. package/src/schema/resolvers/sendOtpCode.test.ts +0 -141
  137. package/src/schema/resolvers/sendOtpCode.ts +0 -52
  138. package/src/security.test.ts +0 -4136
  139. package/src/server/defaultSessionHandler.test.ts +0 -62
  140. package/src/server/defaultSessionHandler.ts +0 -104
  141. package/src/server/generateCodegen.ts +0 -433
  142. package/src/server/index.test.ts +0 -843
  143. package/src/server/index.ts +0 -336
  144. package/src/server/interface.ts +0 -11
  145. package/src/server/routes/authHandler.ts +0 -171
  146. package/src/server/routes/index.ts +0 -48
  147. package/src/utils/crypto.test.ts +0 -41
  148. package/src/utils/crypto.ts +0 -105
  149. package/src/utils/database.ts +0 -8
  150. package/src/utils/export.ts +0 -12
  151. package/src/utils/helper.ts +0 -204
  152. package/src/utils/index.test.ts +0 -11
  153. package/src/utils/index.ts +0 -196
  154. package/src/utils/preload.ts +0 -8
  155. package/src/utils/testHelper.ts +0 -124
  156. package/tsconfig.json +0 -32
@@ -1,412 +0,0 @@
1
- import { describe, expect, it, beforeEach, mock, spyOn } from 'bun:test'
2
- import { _getPermissionPropertiesOfAClass, _checkCLP } from './permissions'
3
- import { HookObject } from './HookObject'
4
- import { OperationType } from '.'
5
- import type { WabeContext } from '../server/interface'
6
- import * as permissions from './permissions'
7
- import { RoleEnum } from '../../generated/wabe'
8
-
9
- describe('Permissions', () => {
10
- describe('Class Level Permissions', () => {
11
- const mockGetObject = mock(() => {})
12
-
13
- const controllers = {
14
- database: {
15
- getObject: mockGetObject,
16
- },
17
- } as any
18
-
19
- beforeEach(() => {
20
- mockGetObject.mockClear()
21
- })
22
-
23
- const config = {
24
- schema: {
25
- classes: [
26
- {
27
- name: 'TestClass',
28
- fields: {
29
- field1: { type: 'String' },
30
- },
31
- permissions: {
32
- read: {
33
- requireAuthentication: true,
34
- authorizedRoles: [RoleEnum.Admin],
35
- },
36
- },
37
- },
38
- {
39
- name: 'TestClass2',
40
- fields: {
41
- field2: { type: 'String' },
42
- },
43
- },
44
- {
45
- name: 'TestClass3',
46
- fields: {
47
- field2: { type: 'String' },
48
- },
49
- permissions: {
50
- read: {
51
- requireAuthentication: true,
52
- authorizedRoles: ['everyone'],
53
- },
54
- },
55
- },
56
- {
57
- name: 'TestClass4',
58
- fields: {
59
- field2: { type: 'String' },
60
- },
61
- permissions: {
62
- read: {
63
- requireAuthentication: true,
64
- authorizedRoles: [],
65
- },
66
- },
67
- },
68
- {
69
- name: 'TestClass5',
70
- fields: {
71
- field2: { type: 'String' },
72
- },
73
- permissions: {},
74
- },
75
- ],
76
- },
77
- } as any
78
-
79
- const context = { wabe: { config } } as any
80
-
81
- it('should throw an error if authorized roles is empty and the user is not root', () => {
82
- mockGetObject.mockResolvedValue({
83
- id: 'sessionId',
84
- user: { id: 'userId' },
85
- } as never)
86
-
87
- const context: WabeContext<any> = {
88
- sessionId: 'sessionId',
89
- user: {
90
- id: 'userId',
91
- role: {
92
- id: 'roleId',
93
- name: 'Admin',
94
- },
95
- },
96
- isRoot: false,
97
- wabe: { controllers, config } as any,
98
- }
99
-
100
- const obj = new HookObject({
101
- className: 'TestClass4',
102
- context,
103
- object: {
104
- id: 'id',
105
- },
106
- operationType: OperationType.BeforeRead,
107
- select: {},
108
- })
109
-
110
- expect(() => _checkCLP(obj, OperationType.BeforeRead)).toThrow(
111
- 'Permission denied to read class TestClass4',
112
- )
113
- })
114
-
115
- it('should throw an error if operation is undefined and user is not root', () => {
116
- mockGetObject.mockResolvedValue({
117
- id: 'sessionId',
118
- user: { id: 'userId' },
119
- } as never)
120
-
121
- const context: WabeContext<any> = {
122
- sessionId: 'sessionId',
123
- user: {
124
- id: 'userId',
125
- role: {
126
- id: 'roleId',
127
- name: 'Admin',
128
- },
129
- },
130
- isRoot: false,
131
- wabe: { controllers, config } as any,
132
- }
133
-
134
- const obj = new HookObject({
135
- className: 'TestClass5',
136
- context,
137
- object: {
138
- id: 'id',
139
- },
140
- operationType: OperationType.BeforeRead,
141
- select: {},
142
- })
143
-
144
- expect(() => _checkCLP(obj, OperationType.BeforeRead)).toThrow(
145
- 'Permission denied to read class TestClass5',
146
- )
147
- })
148
-
149
- it('should get the permission for a given className', () => {
150
- const permission = _getPermissionPropertiesOfAClass({
151
- className: 'TestClass',
152
- operation: 'read',
153
- context,
154
- })
155
-
156
- expect(permission).toEqual({
157
- requireAuthentication: true,
158
- authorizedRoles: [RoleEnum.Admin],
159
- })
160
-
161
- const permission2 = _getPermissionPropertiesOfAClass({
162
- className: 'TestClass2',
163
- operation: 'read',
164
- context,
165
- })
166
-
167
- expect(permission2).toBeUndefined()
168
- })
169
-
170
- it('should throw permission denied if no session id is provided but class require authentication', () => {
171
- const context: WabeContext<any> = {
172
- sessionId: '',
173
- user: {},
174
- isRoot: false,
175
- wabe: { controllers, config } as any,
176
- }
177
-
178
- const obj = new HookObject({
179
- className: 'TestClass',
180
- context,
181
- object: {
182
- id: 'id',
183
- },
184
- operationType: OperationType.BeforeRead,
185
- select: {},
186
- })
187
-
188
- expect(() => _checkCLP(obj, OperationType.BeforeRead)).toThrow(
189
- 'Permission denied to read class TestClass',
190
- )
191
- })
192
-
193
- it('should not throw permission denied if authorized roles is everyone', () => {
194
- mockGetObject.mockResolvedValue({
195
- id: 'sessionId',
196
- user: { id: 'userId' },
197
- } as never)
198
-
199
- const context: WabeContext<any> = {
200
- sessionId: 'sessionId',
201
- user: {
202
- id: 'userId',
203
- role: {
204
- id: 'roleId',
205
- name: 'Role',
206
- } as any,
207
- } as any,
208
- isRoot: false,
209
- wabe: {
210
- controllers,
211
- config,
212
- } as any,
213
- }
214
-
215
- const obj = new HookObject({
216
- className: 'TestClass3',
217
- context,
218
- object: {
219
- id: 'id',
220
- },
221
- operationType: OperationType.BeforeRead,
222
- select: {},
223
- })
224
-
225
- _checkCLP(obj, OperationType.BeforeRead)
226
- })
227
-
228
- it('should throw permission denied if authorized roles is everyone but requireAuthentication is true and client is anonymous', () => {
229
- mockGetObject.mockResolvedValue({
230
- id: 'sessionId',
231
- user: { id: 'userId' },
232
- } as never)
233
-
234
- const context: WabeContext<any> = {
235
- sessionId: undefined,
236
- user: undefined,
237
- isRoot: false,
238
- wabe: {
239
- controllers,
240
- config,
241
- } as any,
242
- }
243
-
244
- const obj = new HookObject({
245
- className: 'TestClass3',
246
- context,
247
- object: {
248
- id: 'id',
249
- },
250
- operationType: OperationType.BeforeRead,
251
- select: {},
252
- })
253
-
254
- expect(() => _checkCLP(obj, OperationType.BeforeRead)).toThrow(
255
- 'Permission denied to read class TestClass3',
256
- )
257
- })
258
-
259
- it('should throw permission denied if role is not an authorized role', () => {
260
- mockGetObject.mockResolvedValue({
261
- id: 'sessionId',
262
- user: { id: 'userId' },
263
- } as never)
264
-
265
- const context: WabeContext<any> = {
266
- sessionId: 'sessionId',
267
- user: {
268
- id: 'userId',
269
- role: {
270
- id: 'roleId',
271
- name: 'Role',
272
- } as any,
273
- } as any,
274
- isRoot: false,
275
- wabe: {
276
- controllers,
277
- config,
278
- } as any,
279
- }
280
-
281
- const obj = new HookObject({
282
- className: 'TestClass',
283
- context,
284
- object: {
285
- id: 'id',
286
- },
287
- operationType: OperationType.BeforeRead,
288
- select: {},
289
- })
290
-
291
- expect(() => _checkCLP(obj, OperationType.BeforeRead)).toThrow(
292
- 'Permission denied to read class TestClass',
293
- )
294
- })
295
-
296
- it('should not throw permission denied if valid session id is provided', () => {
297
- mockGetObject.mockResolvedValue({
298
- id: 'sessionId',
299
- user: { id: 'userId' },
300
- } as never)
301
-
302
- const context: WabeContext<any> = {
303
- sessionId: 'sessionId',
304
- user: {
305
- id: 'userId',
306
- role: {
307
- id: 'roleId',
308
- name: 'Admin',
309
- } as any,
310
- } as any,
311
- isRoot: false,
312
- wabe: {
313
- controllers,
314
- config,
315
- } as any,
316
- }
317
-
318
- const obj = new HookObject({
319
- className: 'TestClass',
320
- context,
321
- object: { id: 'id' },
322
- operationType: OperationType.BeforeRead,
323
- select: {},
324
- })
325
-
326
- _checkCLP(obj, OperationType.BeforeRead)
327
- })
328
-
329
- it('should not throw permission denied if client is root', () => {
330
- const context: WabeContext<any> = {
331
- sessionId: '',
332
- user: {
333
- id: '',
334
- } as any,
335
- isRoot: true,
336
- wabe: { controllers, config } as any,
337
- }
338
-
339
- const obj = new HookObject({
340
- className: 'TestClass',
341
- context,
342
- object: { id: 'id' },
343
- operationType: OperationType.BeforeRead,
344
- select: {},
345
- })
346
-
347
- _checkCLP(obj, OperationType.BeforeRead)
348
- })
349
-
350
- it('should call _checkPermission on beforeRead', () => {
351
- const spyBeforeRead = spyOn(permissions, 'defaultCheckPermissionOnRead').mockReturnValue()
352
-
353
- permissions.defaultCheckPermissionOnRead({} as never)
354
-
355
- expect(spyBeforeRead).toHaveBeenCalledTimes(1)
356
- expect(spyBeforeRead).toHaveBeenCalledWith({})
357
-
358
- spyBeforeRead.mockRestore()
359
- })
360
-
361
- it('should call _checkPermission on beforeCreate', () => {
362
- const spyBeforeCreate = spyOn(permissions, 'defaultCheckPermissionOnCreate').mockReturnValue()
363
-
364
- permissions.defaultCheckPermissionOnCreate({
365
- sessionId: 'sessionId',
366
- user: { id: 'userId' },
367
- } as never)
368
-
369
- expect(spyBeforeCreate).toHaveBeenCalledTimes(1)
370
- expect(spyBeforeCreate).toHaveBeenCalledWith({
371
- sessionId: 'sessionId',
372
- user: { id: 'userId' },
373
- })
374
-
375
- spyBeforeCreate.mockRestore()
376
- })
377
-
378
- it('should call _checkPermission on beforeUpdate', () => {
379
- const spyBeforeUpdate = spyOn(permissions, 'defaultCheckPermissionOnUpdate').mockReturnValue()
380
-
381
- permissions.defaultCheckPermissionOnUpdate({
382
- sessionId: 'sessionId',
383
- user: { id: 'userId' },
384
- } as never)
385
-
386
- expect(spyBeforeUpdate).toHaveBeenCalledTimes(1)
387
- expect(spyBeforeUpdate).toHaveBeenCalledWith({
388
- sessionId: 'sessionId',
389
- user: { id: 'userId' },
390
- })
391
-
392
- spyBeforeUpdate.mockRestore()
393
- })
394
-
395
- it('should call _checkPermission on beforeDelete', () => {
396
- const spyBeforeDelete = spyOn(permissions, 'defaultCheckPermissionOnDelete').mockReturnValue()
397
-
398
- permissions.defaultCheckPermissionOnDelete({
399
- sessionId: 'sessionId',
400
- user: { id: 'userId' },
401
- } as never)
402
-
403
- expect(spyBeforeDelete).toHaveBeenCalledTimes(1)
404
- expect(spyBeforeDelete).toHaveBeenCalledWith({
405
- sessionId: 'sessionId',
406
- user: { id: 'userId' },
407
- })
408
-
409
- spyBeforeDelete.mockRestore()
410
- })
411
- })
412
- })
@@ -1,93 +0,0 @@
1
- import type { PermissionsOperations } from '../schema'
2
- import type { WabeContext } from '../server/interface'
3
- import type { HookObject } from './HookObject'
4
- import { OperationType } from './index'
5
-
6
- const convertOperationTypeToPermission = (operationType: OperationType) => {
7
- const template: Record<OperationType, PermissionsOperations> = {
8
- [OperationType.BeforeCreate]: 'create',
9
- [OperationType.AfterCreate]: 'create',
10
- [OperationType.BeforeRead]: 'read',
11
- [OperationType.AfterRead]: 'read',
12
- [OperationType.BeforeDelete]: 'delete',
13
- [OperationType.AfterDelete]: 'delete',
14
- [OperationType.BeforeUpdate]: 'update',
15
- [OperationType.AfterUpdate]: 'update',
16
- }
17
-
18
- return template[operationType]
19
- }
20
-
21
- export const _getPermissionPropertiesOfAClass = ({
22
- className,
23
- operation,
24
- context,
25
- }: {
26
- className: string
27
- operation: PermissionsOperations
28
- context: WabeContext<any>
29
- }) => {
30
- const wabeClass = context.wabe.config.schema?.classes?.find((c) => c.name === className)
31
-
32
- if (!wabeClass) throw new Error(`Class ${className} not found in schema`)
33
-
34
- const permission = wabeClass.permissions?.[operation]
35
-
36
- return permission
37
- }
38
-
39
- export const _checkCLP = (object: HookObject<any, any>, operationType: OperationType) => {
40
- if (object.context.isRoot) return
41
-
42
- const permissionOperation = convertOperationTypeToPermission(operationType)
43
-
44
- if (!permissionOperation) throw new Error('Bad operation type provided')
45
-
46
- const permissionProperties = _getPermissionPropertiesOfAClass({
47
- className: object.className,
48
- operation: permissionOperation,
49
- context: object.context,
50
- })
51
-
52
- // If no permission is defined by default we throw an error, Zero trust principle
53
- if (!permissionProperties)
54
- throw new Error(`Permission denied to ${permissionOperation} class ${object.className}`)
55
-
56
- const sessionId = object.context.sessionId
57
-
58
- if (!permissionProperties.requireAuthentication && !permissionProperties.authorizedRoles) return
59
-
60
- // User is not corrected but requireAuthentication is on true
61
- if (!sessionId || !object.getUser()) {
62
- throw new Error(`Permission denied to ${permissionOperation} class ${object.className}`)
63
- }
64
-
65
- if (permissionProperties.authorizedRoles?.includes('everyone')) return
66
-
67
- // authorizedRoles is empty
68
- if (permissionProperties.authorizedRoles?.length === 0 || !permissionProperties)
69
- throw new Error(`Permission denied to ${permissionOperation} class ${object.className}`)
70
-
71
- const roleName = object.context.user?.role?.name
72
-
73
- // No role name found
74
- if (!roleName) {
75
- throw new Error(`Permission denied to ${permissionOperation} class ${object.className}`)
76
- }
77
-
78
- // The role of the user is not included in the authorizedRoles
79
- if (!permissionProperties.authorizedRoles?.includes(roleName))
80
- throw new Error(`Permission denied to ${permissionOperation} class ${object.className}`)
81
- }
82
-
83
- export const defaultCheckPermissionOnRead = (object: HookObject<any, any>) =>
84
- _checkCLP(object, OperationType.BeforeRead)
85
-
86
- export const defaultCheckPermissionOnCreate = (object: HookObject<any, any>) =>
87
- _checkCLP(object, OperationType.BeforeCreate)
88
-
89
- export const defaultCheckPermissionOnUpdate = (object: HookObject<any, any>) =>
90
- _checkCLP(object, OperationType.BeforeUpdate)
91
-
92
- export const defaultCheckPermissionOnDelete = (object: HookObject<any, any>) =>
93
- _checkCLP(object, OperationType.BeforeDelete)