@appcorp/fusion-storybook 0.5.1 → 0.5.4
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/base-modules/workspace/cache.d.ts +10 -1
- package/base-modules/workspace/cache.js +37 -2
- package/base-modules/workspace/context.d.ts +36 -2
- package/base-modules/workspace/context.js +62 -17
- package/base-modules/workspace/form.js +14 -11
- package/base-modules/workspace/page.d.ts +5 -0
- package/base-modules/workspace/page.js +1 -1
- package/base-modules/workspace/view.js +11 -11
- package/base-modules/workspace-user/context.d.ts +11 -5
- package/base-modules/workspace-user/context.js +99 -32
- package/base-modules/workspace-user/form.js +59 -1
- package/base-modules/workspace-user/more-actions.js +3 -4
- package/base-modules/workspace-user/page.js +2 -2
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/user-management.d.ts +2 -1
- package/utils/resolve-rbac-permissions.js +84 -1
|
@@ -37,7 +37,8 @@ export interface PlanBE {
|
|
|
37
37
|
*/
|
|
38
38
|
export interface WorkspaceBE {
|
|
39
39
|
agreedCurrency: CURRENCY;
|
|
40
|
-
|
|
40
|
+
/** Prisma `Decimal` — serialised as a string by JSON. */
|
|
41
|
+
agreedPrice: number | string;
|
|
41
42
|
billingDate: number;
|
|
42
43
|
billingInterval: BILLING_INTERVAL;
|
|
43
44
|
classesCount: number;
|
|
@@ -167,10 +167,11 @@ export function resolveRbacPermissions({ userRole, moduleName, }) {
|
|
|
167
167
|
}
|
|
168
168
|
// dashboard footer
|
|
169
169
|
if (moduleName === "Workspace") {
|
|
170
|
+
// Workspace settings expose billing and encrypted secrets — admins only.
|
|
170
171
|
return ({
|
|
171
172
|
[USER_ROLE.SUPER_ADMIN]: true,
|
|
172
173
|
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
173
|
-
[USER_ROLE.STAFF]:
|
|
174
|
+
[USER_ROLE.STAFF]: false,
|
|
174
175
|
[USER_ROLE.TEACHER]: false,
|
|
175
176
|
[USER_ROLE.STUDENT]: false,
|
|
176
177
|
[USER_ROLE.PARENT]: false,
|
|
@@ -257,5 +258,87 @@ export function resolveRbacPermissions({ userRole, moduleName, }) {
|
|
|
257
258
|
[USER_ROLE.PARENT]: false,
|
|
258
259
|
}[userRole] || false);
|
|
259
260
|
}
|
|
261
|
+
// Academic structure — matches the API seed (members read, staff write).
|
|
262
|
+
if (moduleName === "Campus") {
|
|
263
|
+
return ({
|
|
264
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
265
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
266
|
+
[USER_ROLE.STAFF]: true,
|
|
267
|
+
[USER_ROLE.TEACHER]: true,
|
|
268
|
+
[USER_ROLE.STUDENT]: true,
|
|
269
|
+
[USER_ROLE.PARENT]: true,
|
|
270
|
+
}[userRole] || false);
|
|
271
|
+
}
|
|
272
|
+
if (moduleName === "Class") {
|
|
273
|
+
return ({
|
|
274
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
275
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
276
|
+
[USER_ROLE.STAFF]: true,
|
|
277
|
+
[USER_ROLE.TEACHER]: true,
|
|
278
|
+
[USER_ROLE.STUDENT]: true,
|
|
279
|
+
[USER_ROLE.PARENT]: true,
|
|
280
|
+
}[userRole] || false);
|
|
281
|
+
}
|
|
282
|
+
if (moduleName === "Section") {
|
|
283
|
+
return ({
|
|
284
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
285
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
286
|
+
[USER_ROLE.STAFF]: true,
|
|
287
|
+
[USER_ROLE.TEACHER]: true,
|
|
288
|
+
[USER_ROLE.STUDENT]: true,
|
|
289
|
+
[USER_ROLE.PARENT]: true,
|
|
290
|
+
}[userRole] || false);
|
|
291
|
+
}
|
|
292
|
+
if (moduleName === "Subject") {
|
|
293
|
+
return ({
|
|
294
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
295
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
296
|
+
[USER_ROLE.STAFF]: true,
|
|
297
|
+
[USER_ROLE.TEACHER]: true,
|
|
298
|
+
[USER_ROLE.STUDENT]: true,
|
|
299
|
+
[USER_ROLE.PARENT]: true,
|
|
300
|
+
}[userRole] || false);
|
|
301
|
+
}
|
|
302
|
+
// People management — admin/staff surfaces only.
|
|
303
|
+
if (moduleName === "Teacher") {
|
|
304
|
+
return ({
|
|
305
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
306
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
307
|
+
[USER_ROLE.STAFF]: true,
|
|
308
|
+
[USER_ROLE.TEACHER]: false,
|
|
309
|
+
[USER_ROLE.STUDENT]: false,
|
|
310
|
+
[USER_ROLE.PARENT]: false,
|
|
311
|
+
}[userRole] || false);
|
|
312
|
+
}
|
|
313
|
+
if (moduleName === "Family") {
|
|
314
|
+
return ({
|
|
315
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
316
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
317
|
+
[USER_ROLE.STAFF]: true,
|
|
318
|
+
[USER_ROLE.TEACHER]: false,
|
|
319
|
+
[USER_ROLE.STUDENT]: false,
|
|
320
|
+
[USER_ROLE.PARENT]: false,
|
|
321
|
+
}[userRole] || false);
|
|
322
|
+
}
|
|
323
|
+
if (moduleName === "Family Member") {
|
|
324
|
+
return ({
|
|
325
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
326
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
327
|
+
[USER_ROLE.STAFF]: true,
|
|
328
|
+
[USER_ROLE.TEACHER]: false,
|
|
329
|
+
[USER_ROLE.STUDENT]: false,
|
|
330
|
+
[USER_ROLE.PARENT]: false,
|
|
331
|
+
}[userRole] || false);
|
|
332
|
+
}
|
|
333
|
+
if (moduleName === "Student Profile") {
|
|
334
|
+
return ({
|
|
335
|
+
[USER_ROLE.SUPER_ADMIN]: true,
|
|
336
|
+
[USER_ROLE.SCHOOL_ADMIN]: true,
|
|
337
|
+
[USER_ROLE.STAFF]: true,
|
|
338
|
+
[USER_ROLE.TEACHER]: false,
|
|
339
|
+
[USER_ROLE.STUDENT]: false,
|
|
340
|
+
[USER_ROLE.PARENT]: false,
|
|
341
|
+
}[userRole] || false);
|
|
342
|
+
}
|
|
260
343
|
return false;
|
|
261
344
|
}
|