@firecms/user_management 3.0.0-canary.114 → 3.0.0-canary.116

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/dist/index.umd.js CHANGED
@@ -278,7 +278,7 @@
278
278
  console.debug("Deleting", role);
279
279
  const { id } = role;
280
280
  const entity = {
281
- path: usersPath,
281
+ path: rolesPath,
282
282
  id,
283
283
  values: {}
284
284
  };
@@ -509,201 +509,234 @@
509
509
  /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: touched.id && Boolean(errors.id) ? errors.id : "ID of this role" })
510
510
  ] }),
511
511
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12", children: [
512
- /* @__PURE__ */ jsxRuntime.jsx(
513
- ui.Paper,
514
- {
515
- className: "bg-inherit",
516
- children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Table, { children: [
517
- /* @__PURE__ */ jsxRuntime.jsxs(ui.TableHeader, { children: [
518
- /* @__PURE__ */ jsxRuntime.jsx(ui.TableCell, {}),
519
- /* @__PURE__ */ jsxRuntime.jsx(
520
- ui.TableCell,
521
- {
522
- align: "center",
523
- children: "Create entities"
524
- }
525
- ),
526
- /* @__PURE__ */ jsxRuntime.jsx(
527
- ui.TableCell,
528
- {
529
- align: "center",
530
- children: "Read entities"
531
- }
532
- ),
533
- /* @__PURE__ */ jsxRuntime.jsx(
534
- ui.TableCell,
535
- {
536
- align: "center",
537
- children: "Update entities"
538
- }
539
- ),
540
- /* @__PURE__ */ jsxRuntime.jsx(
541
- ui.TableCell,
542
- {
543
- align: "center",
544
- children: "Delete entities"
545
- }
546
- )
547
- ] }),
548
- /* @__PURE__ */ jsxRuntime.jsxs(ui.TableBody, { children: [
549
- /* @__PURE__ */ jsxRuntime.jsxs(ui.TableRow, { children: [
550
- /* @__PURE__ */ jsxRuntime.jsx(
551
- ui.TableCell,
552
- {
553
- scope: "row",
554
- children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "All collections" })
555
- }
556
- ),
557
- /* @__PURE__ */ jsxRuntime.jsx(
558
- ui.TableCell,
512
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Paper, { className: "bg-inherit overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Table, { className: "w-full rounded-md", children: [
513
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.TableHeader, { className: "rounded-md", children: [
514
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TableCell, {}),
515
+ /* @__PURE__ */ jsxRuntime.jsx(
516
+ ui.TableCell,
517
+ {
518
+ align: "center",
519
+ children: "Create entities"
520
+ }
521
+ ),
522
+ /* @__PURE__ */ jsxRuntime.jsx(
523
+ ui.TableCell,
524
+ {
525
+ align: "center",
526
+ children: "Read entities"
527
+ }
528
+ ),
529
+ /* @__PURE__ */ jsxRuntime.jsx(
530
+ ui.TableCell,
531
+ {
532
+ align: "center",
533
+ children: "Update entities"
534
+ }
535
+ ),
536
+ /* @__PURE__ */ jsxRuntime.jsx(
537
+ ui.TableCell,
538
+ {
539
+ align: "center",
540
+ children: "Delete entities"
541
+ }
542
+ ),
543
+ /* @__PURE__ */ jsxRuntime.jsx(
544
+ ui.TableCell,
545
+ {
546
+ align: "center"
547
+ }
548
+ )
549
+ ] }),
550
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.TableBody, { children: [
551
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.TableRow, { children: [
552
+ /* @__PURE__ */ jsxRuntime.jsx(
553
+ ui.TableCell,
554
+ {
555
+ scope: "row",
556
+ children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "All collections" })
557
+ }
558
+ ),
559
+ /* @__PURE__ */ jsxRuntime.jsx(
560
+ ui.TableCell,
561
+ {
562
+ align: "center",
563
+ children: /* @__PURE__ */ jsxRuntime.jsx(
564
+ ui.Tooltip,
559
565
  {
560
- align: "center",
566
+ title: "Create entities in collections",
561
567
  children: /* @__PURE__ */ jsxRuntime.jsx(
562
- ui.Tooltip,
568
+ ui.Checkbox,
563
569
  {
564
- title: "Create entities in collections",
565
- children: /* @__PURE__ */ jsxRuntime.jsx(
566
- ui.Checkbox,
567
- {
568
- disabled: isAdmin || !editable,
569
- checked: (isAdmin || defaultCreate) ?? false,
570
- onCheckedChange: (checked) => setFieldValue("defaultPermissions.create", checked)
571
- }
572
- )
570
+ disabled: isAdmin || !editable,
571
+ checked: (isAdmin || defaultCreate) ?? false,
572
+ onCheckedChange: (checked) => setFieldValue("defaultPermissions.create", checked)
573
573
  }
574
574
  )
575
575
  }
576
- ),
577
- /* @__PURE__ */ jsxRuntime.jsx(
578
- ui.TableCell,
576
+ )
577
+ }
578
+ ),
579
+ /* @__PURE__ */ jsxRuntime.jsx(
580
+ ui.TableCell,
581
+ {
582
+ align: "center",
583
+ children: /* @__PURE__ */ jsxRuntime.jsx(
584
+ ui.Tooltip,
579
585
  {
580
- align: "center",
586
+ title: "Access all data in every collection",
581
587
  children: /* @__PURE__ */ jsxRuntime.jsx(
582
- ui.Tooltip,
588
+ ui.Checkbox,
583
589
  {
584
- title: "Access all data in every collection",
585
- children: /* @__PURE__ */ jsxRuntime.jsx(
586
- ui.Checkbox,
587
- {
588
- disabled: isAdmin || !editable,
589
- checked: (isAdmin || defaultRead) ?? false,
590
- onCheckedChange: (checked) => setFieldValue("defaultPermissions.read", checked)
591
- }
592
- )
590
+ disabled: isAdmin || !editable,
591
+ checked: (isAdmin || defaultRead) ?? false,
592
+ onCheckedChange: (checked) => setFieldValue("defaultPermissions.read", checked)
593
593
  }
594
594
  )
595
595
  }
596
- ),
597
- /* @__PURE__ */ jsxRuntime.jsx(
598
- ui.TableCell,
596
+ )
597
+ }
598
+ ),
599
+ /* @__PURE__ */ jsxRuntime.jsx(
600
+ ui.TableCell,
601
+ {
602
+ align: "center",
603
+ children: /* @__PURE__ */ jsxRuntime.jsx(
604
+ ui.Tooltip,
599
605
  {
600
- align: "center",
606
+ title: "Update data in any collection",
601
607
  children: /* @__PURE__ */ jsxRuntime.jsx(
602
- ui.Tooltip,
608
+ ui.Checkbox,
603
609
  {
604
- title: "Update data in any collection",
605
- children: /* @__PURE__ */ jsxRuntime.jsx(
606
- ui.Checkbox,
607
- {
608
- disabled: isAdmin || !editable,
609
- checked: (isAdmin || defaultEdit) ?? false,
610
- onCheckedChange: (checked) => setFieldValue("defaultPermissions.edit", checked)
611
- }
612
- )
610
+ disabled: isAdmin || !editable,
611
+ checked: (isAdmin || defaultEdit) ?? false,
612
+ onCheckedChange: (checked) => setFieldValue("defaultPermissions.edit", checked)
613
613
  }
614
614
  )
615
615
  }
616
- ),
617
- /* @__PURE__ */ jsxRuntime.jsx(
618
- ui.TableCell,
616
+ )
617
+ }
618
+ ),
619
+ /* @__PURE__ */ jsxRuntime.jsx(
620
+ ui.TableCell,
621
+ {
622
+ align: "center",
623
+ children: /* @__PURE__ */ jsxRuntime.jsx(
624
+ ui.Tooltip,
619
625
  {
620
- align: "center",
626
+ title: "Delete data in any collection",
621
627
  children: /* @__PURE__ */ jsxRuntime.jsx(
622
- ui.Tooltip,
628
+ ui.Checkbox,
623
629
  {
624
- title: "Delete data in any collection",
625
- children: /* @__PURE__ */ jsxRuntime.jsx(
626
- ui.Checkbox,
627
- {
628
- disabled: isAdmin || !editable,
629
- checked: (isAdmin || defaultDelete) ?? false,
630
- onCheckedChange: (checked) => setFieldValue("defaultPermissions.delete", checked)
631
- }
632
- )
630
+ disabled: isAdmin || !editable,
631
+ checked: (isAdmin || defaultDelete) ?? false,
632
+ onCheckedChange: (checked) => setFieldValue("defaultPermissions.delete", checked)
633
633
  }
634
634
  )
635
635
  }
636
636
  )
637
- ] }),
638
- collections && collections.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(ui.TableRow, { children: [
639
- /* @__PURE__ */ jsxRuntime.jsx(
640
- ui.TableCell,
637
+ }
638
+ ),
639
+ /* @__PURE__ */ jsxRuntime.jsx(
640
+ ui.TableCell,
641
+ {
642
+ align: "center"
643
+ }
644
+ )
645
+ ] }),
646
+ collections && collections.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(ui.TableRow, { children: [
647
+ /* @__PURE__ */ jsxRuntime.jsx(
648
+ ui.TableCell,
649
+ {
650
+ scope: "row",
651
+ children: col.name
652
+ }
653
+ ),
654
+ /* @__PURE__ */ jsxRuntime.jsx(
655
+ ui.TableCell,
656
+ {
657
+ align: "center",
658
+ children: /* @__PURE__ */ jsxRuntime.jsx(
659
+ ui.Checkbox,
641
660
  {
642
- scope: "row",
643
- children: col.name
661
+ disabled: isAdmin || defaultCreate || !editable,
662
+ checked: (isAdmin || defaultCreate || formex.getIn(values, `collectionPermissions.${col.path}.create`)) ?? false,
663
+ onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.create`, checked)
644
664
  }
645
- ),
646
- /* @__PURE__ */ jsxRuntime.jsx(
647
- ui.TableCell,
665
+ )
666
+ }
667
+ ),
668
+ /* @__PURE__ */ jsxRuntime.jsx(
669
+ ui.TableCell,
670
+ {
671
+ align: "center",
672
+ children: /* @__PURE__ */ jsxRuntime.jsx(
673
+ ui.Checkbox,
648
674
  {
649
- align: "center",
650
- children: /* @__PURE__ */ jsxRuntime.jsx(
651
- ui.Checkbox,
652
- {
653
- disabled: isAdmin || defaultCreate || !editable,
654
- checked: (isAdmin || defaultCreate || formex.getIn(values, `collectionPermissions.${col.path}.create`)) ?? false,
655
- onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.create`, checked)
656
- }
657
- )
675
+ disabled: isAdmin || defaultRead || !editable,
676
+ checked: (isAdmin || defaultRead || formex.getIn(values, `collectionPermissions.${col.path}.read`)) ?? false,
677
+ onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.read`, checked)
658
678
  }
659
- ),
660
- /* @__PURE__ */ jsxRuntime.jsx(
661
- ui.TableCell,
679
+ )
680
+ }
681
+ ),
682
+ /* @__PURE__ */ jsxRuntime.jsx(
683
+ ui.TableCell,
684
+ {
685
+ align: "center",
686
+ children: /* @__PURE__ */ jsxRuntime.jsx(
687
+ ui.Checkbox,
662
688
  {
663
- align: "center",
664
- children: /* @__PURE__ */ jsxRuntime.jsx(
665
- ui.Checkbox,
666
- {
667
- disabled: isAdmin || defaultRead || !editable,
668
- checked: (isAdmin || defaultRead || formex.getIn(values, `collectionPermissions.${col.path}.read`)) ?? false,
669
- onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.read`, checked)
670
- }
671
- )
689
+ disabled: isAdmin || defaultEdit || !editable,
690
+ checked: (isAdmin || defaultEdit || formex.getIn(values, `collectionPermissions.${col.path}.edit`)) ?? false,
691
+ onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.edit`, checked)
672
692
  }
673
- ),
674
- /* @__PURE__ */ jsxRuntime.jsx(
675
- ui.TableCell,
693
+ )
694
+ }
695
+ ),
696
+ /* @__PURE__ */ jsxRuntime.jsx(
697
+ ui.TableCell,
698
+ {
699
+ align: "center",
700
+ children: /* @__PURE__ */ jsxRuntime.jsx(
701
+ ui.Checkbox,
676
702
  {
677
- align: "center",
678
- children: /* @__PURE__ */ jsxRuntime.jsx(
679
- ui.Checkbox,
680
- {
681
- disabled: isAdmin || defaultEdit || !editable,
682
- checked: (isAdmin || defaultEdit || formex.getIn(values, `collectionPermissions.${col.path}.edit`)) ?? false,
683
- onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.edit`, checked)
684
- }
685
- )
703
+ disabled: isAdmin || defaultDelete || !editable,
704
+ checked: (isAdmin || defaultDelete || formex.getIn(values, `collectionPermissions.${col.path}.delete`)) ?? false,
705
+ onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.delete`, checked)
686
706
  }
687
- ),
688
- /* @__PURE__ */ jsxRuntime.jsx(
689
- ui.TableCell,
707
+ )
708
+ }
709
+ ),
710
+ /* @__PURE__ */ jsxRuntime.jsx(
711
+ ui.TableCell,
712
+ {
713
+ align: "center",
714
+ children: /* @__PURE__ */ jsxRuntime.jsx(
715
+ ui.Tooltip,
690
716
  {
691
- align: "center",
717
+ title: "Allow all permissions in this collections",
692
718
  children: /* @__PURE__ */ jsxRuntime.jsx(
693
- ui.Checkbox,
719
+ ui.Button,
694
720
  {
695
- disabled: isAdmin || defaultDelete || !editable,
696
- checked: (isAdmin || defaultDelete || formex.getIn(values, `collectionPermissions.${col.path}.delete`)) ?? false,
697
- onCheckedChange: (checked) => setFieldValue(`collectionPermissions.${col.path}.delete`, checked)
721
+ className: "color-inherit",
722
+ onClick: () => {
723
+ setFieldValue(`collectionPermissions.${col.path}.create`, true);
724
+ setFieldValue(`collectionPermissions.${col.path}.read`, true);
725
+ setFieldValue(`collectionPermissions.${col.path}.edit`, true);
726
+ setFieldValue(`collectionPermissions.${col.path}.delete`, true);
727
+ },
728
+ disabled: isAdmin || !editable,
729
+ variant: "text",
730
+ children: "All"
698
731
  }
699
732
  )
700
733
  }
701
734
  )
702
- ] }, col.name))
703
- ] })
704
- ] })
705
- }
706
- ),
735
+ }
736
+ )
737
+ ] }, col.name))
738
+ ] })
739
+ ] }) }),
707
740
  /* @__PURE__ */ jsxRuntime.jsx(core.FieldCaption, { children: "You can customise the permissions that the users related to this role can perform in the entities of each collection" })
708
741
  ] }),
709
742
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 md:col-span-4", children: [