@appcorp/fusion-storybook 0.5.3 → 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.
@@ -258,5 +258,87 @@ export function resolveRbacPermissions({ userRole, moduleName, }) {
258
258
  [USER_ROLE.PARENT]: false,
259
259
  }[userRole] || false);
260
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
+ }
261
343
  return false;
262
344
  }