@zealamic/payload-auth-rbac-plugin 1.0.0-beta.1

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 (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +175 -0
  3. package/dist/collections/permission-actions/default-data.js +35 -0
  4. package/dist/collections/permission-actions/default-data.js.map +1 -0
  5. package/dist/collections/permission-actions/index.js +96 -0
  6. package/dist/collections/permission-actions/index.js.map +1 -0
  7. package/dist/collections/permission-actions/types.js +3 -0
  8. package/dist/collections/permission-actions/types.js.map +1 -0
  9. package/dist/collections/permission-features/default-data.js +29 -0
  10. package/dist/collections/permission-features/default-data.js.map +1 -0
  11. package/dist/collections/permission-features/index.js +82 -0
  12. package/dist/collections/permission-features/index.js.map +1 -0
  13. package/dist/collections/permission-features/types.js +3 -0
  14. package/dist/collections/permission-features/types.js.map +1 -0
  15. package/dist/collections/permissions/default-data.js +37 -0
  16. package/dist/collections/permissions/default-data.js.map +1 -0
  17. package/dist/collections/permissions/index.js +102 -0
  18. package/dist/collections/permissions/index.js.map +1 -0
  19. package/dist/collections/permissions/types.js +3 -0
  20. package/dist/collections/permissions/types.js.map +1 -0
  21. package/dist/collections/roles/default-data.js +44 -0
  22. package/dist/collections/roles/default-data.js.map +1 -0
  23. package/dist/collections/roles/hooks/sync-permission-matrix-draft.js +66 -0
  24. package/dist/collections/roles/hooks/sync-permission-matrix-draft.js.map +1 -0
  25. package/dist/collections/roles/index.js +122 -0
  26. package/dist/collections/roles/index.js.map +1 -0
  27. package/dist/collections/roles/types.js +3 -0
  28. package/dist/collections/roles/types.js.map +1 -0
  29. package/dist/collections/roles-permissions/default-data.js +27 -0
  30. package/dist/collections/roles-permissions/default-data.js.map +1 -0
  31. package/dist/collections/roles-permissions/index.js +75 -0
  32. package/dist/collections/roles-permissions/index.js.map +1 -0
  33. package/dist/collections/roles-permissions/types.js +3 -0
  34. package/dist/collections/roles-permissions/types.js.map +1 -0
  35. package/dist/collections/users/default-data.js +19 -0
  36. package/dist/collections/users/default-data.js.map +1 -0
  37. package/dist/collections/users/index.js +135 -0
  38. package/dist/collections/users/index.js.map +1 -0
  39. package/dist/collections/users/parent-path.js +210 -0
  40. package/dist/collections/users/parent-path.js.map +1 -0
  41. package/dist/collections/users/types.js +3 -0
  42. package/dist/collections/users/types.js.map +1 -0
  43. package/dist/components/role-permission-matrix-client/default-data.js +23 -0
  44. package/dist/components/role-permission-matrix-client/default-data.js.map +1 -0
  45. package/dist/components/role-permission-matrix-client/index.js +299 -0
  46. package/dist/components/role-permission-matrix-client/index.js.map +1 -0
  47. package/dist/components/role-permission-matrix-client/types.js +3 -0
  48. package/dist/components/role-permission-matrix-client/types.js.map +1 -0
  49. package/dist/endpoints/customEndpointHandler.js +7 -0
  50. package/dist/endpoints/customEndpointHandler.js.map +1 -0
  51. package/dist/exports/client.js +3 -0
  52. package/dist/exports/client.js.map +1 -0
  53. package/dist/exports/rsc.js +2 -0
  54. package/dist/exports/rsc.js.map +1 -0
  55. package/dist/general-types.d.js +2 -0
  56. package/dist/general-types.d.js.map +1 -0
  57. package/dist/index.js +184 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/lib/constants/general.js +3 -0
  60. package/dist/lib/constants/general.js.map +1 -0
  61. package/dist/lib/constants/index.js +16 -0
  62. package/dist/lib/constants/index.js.map +1 -0
  63. package/dist/lib/constants/permission-action.js +10 -0
  64. package/dist/lib/constants/permission-action.js.map +1 -0
  65. package/dist/lib/constants/permission-feature.js +6 -0
  66. package/dist/lib/constants/permission-feature.js.map +1 -0
  67. package/dist/lib/constants/permission.js +6 -0
  68. package/dist/lib/constants/permission.js.map +1 -0
  69. package/dist/lib/constants/role.js +11 -0
  70. package/dist/lib/constants/role.js.map +1 -0
  71. package/dist/lib/constants/user.js +3 -0
  72. package/dist/lib/constants/user.js.map +1 -0
  73. package/dist/lib/utils/access.js +452 -0
  74. package/dist/lib/utils/access.js.map +1 -0
  75. package/dist/lib/utils/data.js +7 -0
  76. package/dist/lib/utils/data.js.map +1 -0
  77. package/dist/lib/utils/fields.js +41 -0
  78. package/dist/lib/utils/fields.js.map +1 -0
  79. package/dist/lib/utils/index.js +6 -0
  80. package/dist/lib/utils/index.js.map +1 -0
  81. package/dist/lib/utils/localization.js +52 -0
  82. package/dist/lib/utils/localization.js.map +1 -0
  83. package/dist/types.js +10 -0
  84. package/dist/types.js.map +1 -0
  85. package/package.json +122 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zealamic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # @zealamic/payload-auth-rbac-plugin
2
+
3
+ Centralized **role-based access control (RBAC)** for [Payload CMS](https://payloadcms.com) **v3**.
4
+
5
+ ![Payload Auth RBAC Plugin](https://github.com/zealamic/payload-auth-rbac-plugin/blob/main/assets/cover-photo.jpg)
6
+
7
+ Permissions live in the database (feature + action), are assigned to roles, and enforced via reusable access helpers — editable in Admin without redeploying policy code.
8
+
9
+ ---
10
+
11
+ ## Documentation
12
+
13
+ | Guide | Read when you need to… |
14
+ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
15
+ | **[COLLECTIONS](./docs/COLLECTIONS.md)** | Understand plugin collections, users augmentation, `dataScope`, permission matrix, and **customize** fields/access/admin |
16
+ | **[UTILS](./docs/UTILS.md)** | Wire **access helpers** on your app collections (`getPermissionAccess`, data-scope filters, examples) |
17
+ | **[TRANSLATIONS](./docs/TRANSLATIONS.md)** | Localize Admin labels, select options, and permission-matrix UI (`en`, `vi`, …) |
18
+
19
+ **Typical flow:** install → register plugin → seed RBAC data ([COLLECTIONS](./docs/COLLECTIONS.md)) → protect app collections ([UTILS](./docs/UTILS.md)) → translate Admin UI ([TRANSLATIONS](./docs/TRANSLATIONS.md)).
20
+
21
+ Demo: `dev/rbac.ts`, `dev/collections/posts.ts`.
22
+
23
+ ---
24
+
25
+ ## Key features
26
+
27
+ - **Five RBAC collections** — features, actions, permissions, roles, join table ([details](./docs/COLLECTIONS.md))
28
+ - **Multi-role users** — union of enabled grants across assigned roles
29
+ - **Granular permissions** — any `featureCode` + `actionCode` pair ([helpers](./docs/UTILS.md))
30
+ - **Data scope** — per-role `own` / `hierarchy` / `all` for row-level filtering (`[dataScope` vs `isSuperAdmin](./docs/COLLECTIONS.md#what-is-datascope)`)
31
+ - **Permission matrix** — role edit UI; syncs to `roles-permissions` on save
32
+ - **TypeScript** — typed plugin options and exports (`/types`)
33
+ - **i18n** — plugin-owned translations merged into Payload i18n ([guide](./docs/TRANSLATIONS.md))
34
+
35
+ ---
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ npm install @zealamic/payload-auth-rbac-plugin
41
+ # or: yarn add / pnpm add @zealamic/payload-auth-rbac-plugin
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Quick start
47
+
48
+ ### 1. Register the plugin
49
+
50
+ ```ts
51
+ import { payloadAuthRbacPlugin } from "@zealamic/payload-auth-rbac-plugin";
52
+
53
+ export default buildConfig({
54
+ plugins: [
55
+ payloadAuthRbacPlugin({
56
+ autoModifyUsersCollection: true, // roles, isSuperAdmin, parent, default user access
57
+ // collections: { ... } → see docs/COLLECTIONS.md
58
+ // translations: { ... } → see docs/TRANSLATIONS.md
59
+ }),
60
+ ],
61
+ });
62
+ ```
63
+
64
+ ### 2. Seed RBAC data (Admin or script)
65
+
66
+ 1. **permission-features** — e.g. `posts`, `users` (`code` = `featureCode` in access helpers)
67
+ 2. **permission-actions** — e.g. `create`, `read`, `update`, `delete`
68
+ 3. **permissions** — one row per feature + action pair
69
+ 4. **roles** — set `[dataScope](./docs/COLLECTIONS.md#what-is-datascope)`; configure matrix on update screen → Save
70
+ 5. **users** — assign roles; bootstrap `[isSuperAdmin](./docs/COLLECTIONS.md#bootstrap-super-admin)` via seed/API
71
+
72
+ → Full collection reference: **[COLLECTIONS](./docs/COLLECTIONS.md)**
73
+
74
+ ### 3. Protect app collections
75
+
76
+ ```ts
77
+ import {
78
+ getPermissionAccess,
79
+ } from "@zealamic/payload-auth-rbac-plugin";
80
+
81
+ export const Posts: CollectionConfig = {
82
+ slug: "posts",
83
+ access: {
84
+ read: getPermissionAccess({
85
+ featureCode: "posts",
86
+ actionCode: "read",
87
+ // read mode is inferred when options is provided
88
+ options: { createdByField: "createdBy" },
89
+ }),
90
+ create: getPermissionAccess({ featureCode: "posts", actionCode: "create" }),
91
+ update: getPermissionAccess({
92
+ featureCode: "posts",
93
+ actionCode: "update",
94
+ mode: "modify",
95
+ collectionSlug: "posts",
96
+ options: { createdByField: "createdBy" },
97
+ }),
98
+ delete: getPermissionAccess({
99
+ featureCode: "posts",
100
+ actionCode: "delete",
101
+ mode: "modify",
102
+ collectionSlug: "posts",
103
+ options: { createdByField: "createdBy" },
104
+ }),
105
+ },
106
+ hooks: {
107
+ beforeChange: [
108
+ ({ req, data, operation }) => {
109
+ if (operation === "create" && req.user?.id && !data?.createdBy) {
110
+ return { ...data, createdBy: req.user.id };
111
+ }
112
+ return data;
113
+ },
114
+ ],
115
+ },
116
+ fields: [
117
+ { name: "createdBy", type: "relationship", relationTo: "users" /* ... */ },
118
+ ],
119
+ };
120
+ ```
121
+
122
+ **Access order:** anonymous → deny · super admin → allow · else → matrix permission (+ data scope when using scope helpers).
123
+
124
+ → All helpers with examples: **[UTILS](./docs/UTILS.md)**
125
+
126
+ ---
127
+
128
+ ## Plugin options
129
+
130
+ | Option | Default | Description |
131
+ | --------------------------- | ------- | ------------------------------------------------------------------------------------------- |
132
+ | `disabled` | `false` | Skip runtime wiring; schema still registers |
133
+ | `autoModifyUsersCollection` | `true` | Add RBAC fields + access on users collection |
134
+ | `translations` | — | Admin / matrix i18n → **[TRANSLATIONS](./docs/TRANSLATIONS.md)** |
135
+ | `collections` | — | Per-collection overrides → **[COLLECTIONS](./docs/COLLECTIONS.md#customizing-collections)** |
136
+
137
+ Types: `@zealamic/payload-auth-rbac-plugin/types`
138
+
139
+ ---
140
+
141
+ ## Exported helpers (summary)
142
+
143
+ Full reference: **[UTILS](./docs/UTILS.md)**
144
+
145
+ | Function | Purpose |
146
+ | ----------------------------------------------------- | ----------------------------------------------- |
147
+ | `getPermissionAccess` | Unified helper: permission / read scope / modify scope |
148
+ | `getSuperAdminAccess` | Super admin only (RBAC collections default) |
149
+ | `canAccessDocumentByDataScope` | Single-document scope check |
150
+ | `resolveEffectiveDataScope` / `getDataScopeReadWhere` | Scope resolution & query filters |
151
+
152
+ Constants: `CONSTANTS.ROLE.DATA_SCOPE`, etc.
153
+
154
+ ---
155
+
156
+ ## Package exports
157
+
158
+ | Import | Contents |
159
+ | ------------------------------------------- | ------------------------------------- |
160
+ | `@zealamic/payload-auth-rbac-plugin` | Plugin + utils + constants |
161
+ | `@zealamic/payload-auth-rbac-plugin/client` | `RolePermissionMatrixClient` |
162
+ | `@zealamic/payload-auth-rbac-plugin/types` | TypeScript types |
163
+ | `@zealamic/payload-auth-rbac-plugin/utils` | Access / field / localization helpers |
164
+
165
+ ---
166
+
167
+ ## License
168
+
169
+ MIT
170
+
171
+ ---
172
+
173
+ > _If this plugin helps your team ship safer access control with less friction, thank you for giving it a place in your stack._
174
+
175
+
@@ -0,0 +1,35 @@
1
+ export const permissionActionsDefaultTranslations = {
2
+ en: {
3
+ labels: {
4
+ singular: "Permission Action",
5
+ plural: "Permission Actions"
6
+ },
7
+ admin: {
8
+ group: "System"
9
+ },
10
+ fields: {
11
+ code: {
12
+ label: "Code",
13
+ placeholder: "Enter code"
14
+ },
15
+ type: {
16
+ label: "Type",
17
+ placeholder: "Select type",
18
+ mainLabel: "Main",
19
+ subLabel: "Sub"
20
+ },
21
+ sortOrder: {
22
+ label: "Sort Order",
23
+ placeholder: "Enter sort order"
24
+ },
25
+ status: {
26
+ label: "Status",
27
+ placeholder: "Select status",
28
+ activeLabel: "Active",
29
+ inactiveLabel: "Inactive"
30
+ }
31
+ }
32
+ }
33
+ };
34
+
35
+ //# sourceMappingURL=default-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/permission-actions/default-data.ts"],"sourcesContent":["import type { PermissionActionsCollectionTranslations } from \"./types.js\";\n\nexport const permissionActionsDefaultTranslations: PermissionActionsCollectionTranslations =\n {\n en: {\n labels: {\n singular: \"Permission Action\",\n plural: \"Permission Actions\",\n },\n admin: {\n group: \"System\",\n },\n fields: {\n code: {\n label: \"Code\",\n placeholder: \"Enter code\",\n },\n type: {\n label: \"Type\",\n placeholder: \"Select type\",\n mainLabel: \"Main\",\n subLabel: \"Sub\",\n },\n sortOrder: {\n label: \"Sort Order\",\n placeholder: \"Enter sort order\",\n },\n status: {\n label: \"Status\",\n placeholder: \"Select status\",\n activeLabel: \"Active\",\n inactiveLabel: \"Inactive\",\n },\n },\n },\n };\n"],"names":["permissionActionsDefaultTranslations","en","labels","singular","plural","admin","group","fields","code","label","placeholder","type","mainLabel","subLabel","sortOrder","status","activeLabel","inactiveLabel"],"mappings":"AAEA,OAAO,MAAMA,uCACX;IACEC,IAAI;QACFC,QAAQ;YACNC,UAAU;YACVC,QAAQ;QACV;QACAC,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACNC,MAAM;gBACJC,OAAO;gBACPC,aAAa;YACf;YACAC,MAAM;gBACJF,OAAO;gBACPC,aAAa;gBACbE,WAAW;gBACXC,UAAU;YACZ;YACAC,WAAW;gBACTL,OAAO;gBACPC,aAAa;YACf;YACAK,QAAQ;gBACNN,OAAO;gBACPC,aAAa;gBACbM,aAAa;gBACbC,eAAe;YACjB;QACF;IACF;AACF,EAAE"}
@@ -0,0 +1,96 @@
1
+ import { STATUS, TYPE } from "../../lib/constants/permission-action.js";
2
+ import { getArrayOfMergedFieldAffectingData, getSuperAdminAccess, toLocaleRecord, toSelectPlaceholder } from "../../lib/utils/index.js";
3
+ export const getPermissionActionsCollection = (params)=>{
4
+ const { translations = {}, access = {}, fields = [], labels = {}, admin = {} } = params || {};
5
+ const arrTranslationsKeys = Object.keys(translations);
6
+ const permissionActions = {
7
+ slug: "permission-actions",
8
+ labels: {
9
+ singular: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.labels?.singular),
10
+ plural: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.labels?.plural),
11
+ ...labels
12
+ },
13
+ admin: {
14
+ group: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.admin?.group),
15
+ useAsTitle: "code",
16
+ defaultColumns: [
17
+ "code",
18
+ "type",
19
+ "status",
20
+ "updatedAt"
21
+ ],
22
+ ...admin
23
+ },
24
+ access: {
25
+ create: getSuperAdminAccess,
26
+ update: getSuperAdminAccess,
27
+ delete: getSuperAdminAccess,
28
+ read: getSuperAdminAccess,
29
+ readVersions: getSuperAdminAccess,
30
+ unlock: getSuperAdminAccess,
31
+ admin: ({ req })=>{
32
+ return getSuperAdminAccess({
33
+ req
34
+ });
35
+ },
36
+ ...access
37
+ },
38
+ fields: getArrayOfMergedFieldAffectingData({
39
+ fields,
40
+ defaultFields: [
41
+ {
42
+ name: "code",
43
+ type: "text",
44
+ required: true,
45
+ unique: true,
46
+ index: true,
47
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.code?.label),
48
+ admin: {
49
+ placeholder: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.code?.placeholder)
50
+ }
51
+ },
52
+ {
53
+ name: "type",
54
+ type: "select",
55
+ required: true,
56
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.type?.label),
57
+ options: Object.values(TYPE).map((type)=>({
58
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.type?.[`${type}Label`]),
59
+ value: type
60
+ })),
61
+ admin: {
62
+ placeholder: toSelectPlaceholder(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.type?.placeholder)
63
+ }
64
+ },
65
+ {
66
+ name: "sortOrder",
67
+ type: "number",
68
+ required: false,
69
+ defaultValue: 0,
70
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.sortOrder?.label),
71
+ admin: {
72
+ placeholder: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.sortOrder?.placeholder)
73
+ }
74
+ },
75
+ {
76
+ name: "status",
77
+ type: "select",
78
+ required: true,
79
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.status?.label),
80
+ defaultValue: STATUS.ACTIVE,
81
+ options: Object.values(STATUS).map((status)=>({
82
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.status?.[`${status}Label`]),
83
+ value: status
84
+ })),
85
+ admin: {
86
+ placeholder: toSelectPlaceholder(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.status?.placeholder)
87
+ }
88
+ }
89
+ ]
90
+ }),
91
+ timestamps: true
92
+ };
93
+ return permissionActions;
94
+ };
95
+
96
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/permission-actions/index.ts"],"sourcesContent":["import type { CollectionConfig } from \"payload\";\nimport { STATUS, TYPE } from \"../../lib/constants/permission-action.js\";\nimport {\n getArrayOfMergedFieldAffectingData,\n getSuperAdminAccess,\n toLocaleRecord,\n toSelectPlaceholder,\n} from \"../../lib/utils/index.js\";\nimport type { PermissionActionsCollectionParams } from \"./types.js\";\n\nexport const getPermissionActionsCollection = (\n params: PermissionActionsCollectionParams,\n) => {\n const {\n translations = {},\n access = {},\n fields = [],\n labels = {},\n admin = {},\n } = params || {};\n const arrTranslationsKeys = Object.keys(translations);\n const permissionActions: CollectionConfig = {\n slug: \"permission-actions\",\n labels: {\n singular: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.labels?.singular,\n ),\n plural: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.labels?.plural,\n ),\n ...labels,\n },\n admin: {\n group: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.admin?.group,\n ),\n useAsTitle: \"code\",\n defaultColumns: [\"code\", \"type\", \"status\", \"updatedAt\"],\n ...admin,\n },\n access: {\n create: getSuperAdminAccess,\n update: getSuperAdminAccess,\n delete: getSuperAdminAccess,\n read: getSuperAdminAccess,\n readVersions: getSuperAdminAccess,\n unlock: getSuperAdminAccess,\n admin: ({ req }) => {\n return getSuperAdminAccess({ req });\n },\n ...access,\n },\n fields: getArrayOfMergedFieldAffectingData({\n fields,\n defaultFields: [\n {\n name: \"code\",\n type: \"text\",\n required: true,\n unique: true,\n index: true,\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.code?.label,\n ),\n admin: {\n placeholder: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.code?.placeholder,\n ),\n },\n },\n {\n name: \"type\",\n type: \"select\",\n required: true,\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.type?.label,\n ),\n options: Object.values(TYPE).map((type) => ({\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.type?.[`${type}Label`],\n ),\n value: type,\n })),\n admin: {\n placeholder: toSelectPlaceholder(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.type?.placeholder,\n ),\n },\n },\n {\n name: \"sortOrder\",\n type: \"number\",\n required: false,\n defaultValue: 0,\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.sortOrder?.label,\n ),\n admin: {\n placeholder: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.sortOrder?.placeholder,\n ),\n },\n },\n {\n name: \"status\",\n type: \"select\",\n required: true,\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.status?.label,\n ),\n defaultValue: STATUS.ACTIVE,\n options: Object.values(STATUS).map((status) => ({\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) =>\n translations[locale]?.fields?.status?.[`${status}Label`],\n ),\n value: status,\n })),\n admin: {\n placeholder: toSelectPlaceholder(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.status?.placeholder,\n ),\n },\n },\n ],\n }),\n timestamps: true,\n };\n\n return permissionActions;\n};\n"],"names":["STATUS","TYPE","getArrayOfMergedFieldAffectingData","getSuperAdminAccess","toLocaleRecord","toSelectPlaceholder","getPermissionActionsCollection","params","translations","access","fields","labels","admin","arrTranslationsKeys","Object","keys","permissionActions","slug","singular","locale","plural","group","useAsTitle","defaultColumns","create","update","delete","read","readVersions","unlock","req","defaultFields","name","type","required","unique","index","label","code","placeholder","options","values","map","value","defaultValue","sortOrder","status","ACTIVE","timestamps"],"mappings":"AACA,SAASA,MAAM,EAAEC,IAAI,QAAQ,2CAA2C;AACxE,SACEC,kCAAkC,EAClCC,mBAAmB,EACnBC,cAAc,EACdC,mBAAmB,QACd,2BAA2B;AAGlC,OAAO,MAAMC,iCAAiC,CAC5CC;IAEA,MAAM,EACJC,eAAe,CAAC,CAAC,EACjBC,SAAS,CAAC,CAAC,EACXC,SAAS,EAAE,EACXC,SAAS,CAAC,CAAC,EACXC,QAAQ,CAAC,CAAC,EACX,GAAGL,UAAU,CAAC;IACf,MAAMM,sBAAsBC,OAAOC,IAAI,CAACP;IACxC,MAAMQ,oBAAsC;QAC1CC,MAAM;QACNN,QAAQ;YACNO,UAAUd,eACRS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAER,QAAQO;YAE5CE,QAAQhB,eACNS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAER,QAAQS;YAE5C,GAAGT,MAAM;QACX;QACAC,OAAO;YACLS,OAAOjB,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAEP,OAAOS;YAE3CC,YAAY;YACZC,gBAAgB;gBAAC;gBAAQ;gBAAQ;gBAAU;aAAY;YACvD,GAAGX,KAAK;QACV;QACAH,QAAQ;YACNe,QAAQrB;YACRsB,QAAQtB;YACRuB,QAAQvB;YACRwB,MAAMxB;YACNyB,cAAczB;YACd0B,QAAQ1B;YACRS,OAAO,CAAC,EAAEkB,GAAG,EAAE;gBACb,OAAO3B,oBAAoB;oBAAE2B;gBAAI;YACnC;YACA,GAAGrB,MAAM;QACX;QACAC,QAAQR,mCAAmC;YACzCQ;YACAqB,eAAe;gBACb;oBACEC,MAAM;oBACNC,MAAM;oBACNC,UAAU;oBACVC,QAAQ;oBACRC,OAAO;oBACPC,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQ4B,MAAMD;oBAElDzB,OAAO;wBACL2B,aAAanC,eACXS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQ4B,MAAMC;oBAEpD;gBACF;gBACA;oBACEP,MAAM;oBACNC,MAAM;oBACNC,UAAU;oBACVG,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQuB,MAAMI;oBAElDG,SAAS1B,OAAO2B,MAAM,CAACxC,MAAMyC,GAAG,CAAC,CAACT,OAAU,CAAA;4BAC1CI,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQuB,MAAM,CAAC,GAAGA,KAAK,KAAK,CAAC,CAAC;4BAElEU,OAAOV;wBACT,CAAA;oBACArB,OAAO;wBACL2B,aAAalC,oBACXQ,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQuB,MAAMM;oBAEpD;gBACF;gBACA;oBACEP,MAAM;oBACNC,MAAM;oBACNC,UAAU;oBACVU,cAAc;oBACdP,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQmC,WAAWR;oBAEvDzB,OAAO;wBACL2B,aAAanC,eACXS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQmC,WAAWN;oBAEzD;gBACF;gBACA;oBACEP,MAAM;oBACNC,MAAM;oBACNC,UAAU;oBACVG,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQoC,QAAQT;oBAEpDO,cAAc5C,OAAO+C,MAAM;oBAC3BP,SAAS1B,OAAO2B,MAAM,CAACzC,QAAQ0C,GAAG,CAAC,CAACI,SAAY,CAAA;4BAC9CT,OAAOjC,eACLS,qBACA,CAACM,SACCX,YAAY,CAACW,OAAO,EAAET,QAAQoC,QAAQ,CAAC,GAAGA,OAAO,KAAK,CAAC,CAAC;4BAE5DH,OAAOG;wBACT,CAAA;oBACAlC,OAAO;wBACL2B,aAAalC,oBACXQ,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQoC,QAAQP;oBAEtD;gBACF;aACD;QACH;QACAS,YAAY;IACd;IAEA,OAAOhC;AACT,EAAE"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/permission-actions/types.ts"],"sourcesContent":["import type { CollectionConfig, Field } from \"payload\";\nimport { STATUS, TYPE } from \"../../lib/constants/permission-action.js\";\n\nexport type PermissionActionsCollectionTranslations = {\n [locale: string]: {\n labels?: {\n singular?: string;\n plural?: string;\n };\n admin?: {\n group?: string;\n };\n fields?: {\n code?: {\n label?: string;\n placeholder?: string;\n };\n type?: {\n label?: string;\n placeholder?: string;\n mainLabel?: string;\n subLabel?: string;\n };\n sortOrder?: {\n label?: string;\n placeholder?: string;\n };\n status?: {\n label?: string;\n placeholder?: string;\n activeLabel?: string;\n inactiveLabel?: string;\n };\n };\n };\n};\n\nexport type PermissionActionsCollectionParams = {\n translations?: PermissionActionsCollectionTranslations;\n fields?: Field[];\n access?: CollectionConfig[\"access\"];\n labels?: CollectionConfig[\"labels\"];\n admin?: CollectionConfig[\"admin\"];\n};\n\nexport type PermissionActionStatus = (typeof STATUS)[keyof typeof STATUS];\n\nexport type PermissionActionType = (typeof TYPE)[keyof typeof TYPE];\n\nexport type PermissionAction = {\n id: string | number;\n code?: string | null;\n sortOrder?: number | null;\n type?: PermissionActionType | null;\n status?: PermissionActionStatus | null;\n};\n"],"names":[],"mappings":"AAiDA,WAME"}
@@ -0,0 +1,29 @@
1
+ export const permissionFeaturesDefaultTranslations = {
2
+ en: {
3
+ labels: {
4
+ singular: "Permission Feature",
5
+ plural: "Permission Features"
6
+ },
7
+ admin: {
8
+ group: "System"
9
+ },
10
+ fields: {
11
+ code: {
12
+ label: "Code",
13
+ placeholder: "Enter code"
14
+ },
15
+ sortOrder: {
16
+ label: "Sort Order",
17
+ placeholder: "Enter sort order"
18
+ },
19
+ status: {
20
+ label: "Status",
21
+ placeholder: "Select status",
22
+ activeLabel: "Active",
23
+ inactiveLabel: "Inactive"
24
+ }
25
+ }
26
+ }
27
+ };
28
+
29
+ //# sourceMappingURL=default-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/permission-features/default-data.ts"],"sourcesContent":["import type { PermissionFeaturesCollectionTranslations } from \"./types.js\";\n\nexport const permissionFeaturesDefaultTranslations: PermissionFeaturesCollectionTranslations =\n {\n en: {\n labels: {\n singular: \"Permission Feature\",\n plural: \"Permission Features\",\n },\n admin: {\n group: \"System\",\n },\n fields: {\n code: {\n label: \"Code\",\n placeholder: \"Enter code\",\n },\n sortOrder: {\n label: \"Sort Order\",\n placeholder: \"Enter sort order\",\n },\n status: {\n label: \"Status\",\n placeholder: \"Select status\",\n activeLabel: \"Active\",\n inactiveLabel: \"Inactive\",\n },\n },\n },\n };\n"],"names":["permissionFeaturesDefaultTranslations","en","labels","singular","plural","admin","group","fields","code","label","placeholder","sortOrder","status","activeLabel","inactiveLabel"],"mappings":"AAEA,OAAO,MAAMA,wCACX;IACEC,IAAI;QACFC,QAAQ;YACNC,UAAU;YACVC,QAAQ;QACV;QACAC,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACNC,MAAM;gBACJC,OAAO;gBACPC,aAAa;YACf;YACAC,WAAW;gBACTF,OAAO;gBACPC,aAAa;YACf;YACAE,QAAQ;gBACNH,OAAO;gBACPC,aAAa;gBACbG,aAAa;gBACbC,eAAe;YACjB;QACF;IACF;AACF,EAAE"}
@@ -0,0 +1,82 @@
1
+ import { STATUS } from "../../lib/constants/permission-feature.js";
2
+ import { getArrayOfMergedFieldAffectingData, getSuperAdminAccess, toLocaleRecord, toSelectPlaceholder } from "../../lib/utils/index.js";
3
+ export const getPermissionFeaturesCollection = (params)=>{
4
+ const { translations = {}, access = {}, fields = [], labels = {}, admin = {} } = params || {};
5
+ const arrTranslationsKeys = Object.keys(translations);
6
+ const permissionFeatures = {
7
+ slug: "permission-features",
8
+ labels: {
9
+ singular: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.labels?.singular),
10
+ plural: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.labels?.plural),
11
+ ...labels
12
+ },
13
+ admin: {
14
+ group: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.admin?.group),
15
+ useAsTitle: "code",
16
+ defaultColumns: [
17
+ "code",
18
+ "status",
19
+ "updatedAt"
20
+ ],
21
+ ...admin
22
+ },
23
+ access: {
24
+ create: getSuperAdminAccess,
25
+ update: getSuperAdminAccess,
26
+ delete: getSuperAdminAccess,
27
+ read: getSuperAdminAccess,
28
+ readVersions: getSuperAdminAccess,
29
+ unlock: getSuperAdminAccess,
30
+ admin: ({ req })=>{
31
+ return getSuperAdminAccess({
32
+ req
33
+ });
34
+ },
35
+ ...access
36
+ },
37
+ fields: getArrayOfMergedFieldAffectingData({
38
+ fields,
39
+ defaultFields: [
40
+ {
41
+ name: "code",
42
+ type: "text",
43
+ required: true,
44
+ unique: true,
45
+ index: true,
46
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.code?.label),
47
+ admin: {
48
+ placeholder: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.code?.placeholder)
49
+ }
50
+ },
51
+ {
52
+ name: "sortOrder",
53
+ type: "number",
54
+ required: false,
55
+ defaultValue: 0,
56
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.sortOrder?.label),
57
+ admin: {
58
+ placeholder: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.sortOrder?.placeholder)
59
+ }
60
+ },
61
+ {
62
+ name: "status",
63
+ type: "select",
64
+ required: true,
65
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.status?.label),
66
+ defaultValue: STATUS.ACTIVE,
67
+ options: Object.values(STATUS).map((status)=>({
68
+ label: toLocaleRecord(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.status?.[`${status}Label`]),
69
+ value: status
70
+ })),
71
+ admin: {
72
+ placeholder: toSelectPlaceholder(arrTranslationsKeys, (locale)=>translations[locale]?.fields?.status?.placeholder)
73
+ }
74
+ }
75
+ ]
76
+ }),
77
+ timestamps: true
78
+ };
79
+ return permissionFeatures;
80
+ };
81
+
82
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/permission-features/index.ts"],"sourcesContent":["import type { CollectionConfig } from \"payload\";\nimport { STATUS } from \"../../lib/constants/permission-feature.js\";\nimport {\n getArrayOfMergedFieldAffectingData,\n getSuperAdminAccess,\n toLocaleRecord,\n toSelectPlaceholder,\n} from \"../../lib/utils/index.js\";\nimport type { PermissionFeaturesCollectionParams } from \"./types.js\";\n\nexport const getPermissionFeaturesCollection = (\n params: PermissionFeaturesCollectionParams,\n) => {\n const {\n translations = {},\n access = {},\n fields = [],\n labels = {},\n admin = {},\n } = params || {};\n const arrTranslationsKeys = Object.keys(translations);\n const permissionFeatures: CollectionConfig = {\n slug: \"permission-features\",\n labels: {\n singular: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.labels?.singular,\n ),\n plural: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.labels?.plural,\n ),\n ...labels,\n },\n admin: {\n group: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.admin?.group,\n ),\n useAsTitle: \"code\",\n defaultColumns: [\"code\", \"status\", \"updatedAt\"],\n ...admin,\n },\n access: {\n create: getSuperAdminAccess,\n update: getSuperAdminAccess,\n delete: getSuperAdminAccess,\n read: getSuperAdminAccess,\n readVersions: getSuperAdminAccess,\n unlock: getSuperAdminAccess,\n admin: ({ req }) => {\n return getSuperAdminAccess({ req });\n },\n ...access,\n },\n fields: getArrayOfMergedFieldAffectingData({\n fields,\n defaultFields: [\n {\n name: \"code\",\n type: \"text\",\n required: true,\n unique: true,\n index: true,\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.code?.label,\n ),\n admin: {\n placeholder: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.code?.placeholder,\n ),\n },\n },\n {\n name: \"sortOrder\",\n type: \"number\",\n required: false,\n defaultValue: 0,\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.sortOrder?.label,\n ),\n admin: {\n placeholder: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.sortOrder?.placeholder,\n ),\n },\n },\n {\n name: \"status\",\n type: \"select\",\n required: true,\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.status?.label,\n ),\n defaultValue: STATUS.ACTIVE,\n options: Object.values(STATUS).map((status) => ({\n label: toLocaleRecord(\n arrTranslationsKeys,\n (locale) =>\n translations[locale]?.fields?.status?.[`${status}Label`],\n ),\n value: status,\n })),\n admin: {\n placeholder: toSelectPlaceholder(\n arrTranslationsKeys,\n (locale) => translations[locale]?.fields?.status?.placeholder,\n ),\n },\n },\n ],\n }),\n timestamps: true,\n };\n\n return permissionFeatures;\n};\n"],"names":["STATUS","getArrayOfMergedFieldAffectingData","getSuperAdminAccess","toLocaleRecord","toSelectPlaceholder","getPermissionFeaturesCollection","params","translations","access","fields","labels","admin","arrTranslationsKeys","Object","keys","permissionFeatures","slug","singular","locale","plural","group","useAsTitle","defaultColumns","create","update","delete","read","readVersions","unlock","req","defaultFields","name","type","required","unique","index","label","code","placeholder","defaultValue","sortOrder","status","ACTIVE","options","values","map","value","timestamps"],"mappings":"AACA,SAASA,MAAM,QAAQ,4CAA4C;AACnE,SACEC,kCAAkC,EAClCC,mBAAmB,EACnBC,cAAc,EACdC,mBAAmB,QACd,2BAA2B;AAGlC,OAAO,MAAMC,kCAAkC,CAC7CC;IAEA,MAAM,EACJC,eAAe,CAAC,CAAC,EACjBC,SAAS,CAAC,CAAC,EACXC,SAAS,EAAE,EACXC,SAAS,CAAC,CAAC,EACXC,QAAQ,CAAC,CAAC,EACX,GAAGL,UAAU,CAAC;IACf,MAAMM,sBAAsBC,OAAOC,IAAI,CAACP;IACxC,MAAMQ,qBAAuC;QAC3CC,MAAM;QACNN,QAAQ;YACNO,UAAUd,eACRS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAER,QAAQO;YAE5CE,QAAQhB,eACNS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAER,QAAQS;YAE5C,GAAGT,MAAM;QACX;QACAC,OAAO;YACLS,OAAOjB,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAEP,OAAOS;YAE3CC,YAAY;YACZC,gBAAgB;gBAAC;gBAAQ;gBAAU;aAAY;YAC/C,GAAGX,KAAK;QACV;QACAH,QAAQ;YACNe,QAAQrB;YACRsB,QAAQtB;YACRuB,QAAQvB;YACRwB,MAAMxB;YACNyB,cAAczB;YACd0B,QAAQ1B;YACRS,OAAO,CAAC,EAAEkB,GAAG,EAAE;gBACb,OAAO3B,oBAAoB;oBAAE2B;gBAAI;YACnC;YACA,GAAGrB,MAAM;QACX;QACAC,QAAQR,mCAAmC;YACzCQ;YACAqB,eAAe;gBACb;oBACEC,MAAM;oBACNC,MAAM;oBACNC,UAAU;oBACVC,QAAQ;oBACRC,OAAO;oBACPC,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQ4B,MAAMD;oBAElDzB,OAAO;wBACL2B,aAAanC,eACXS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQ4B,MAAMC;oBAEpD;gBACF;gBACA;oBACEP,MAAM;oBACNC,MAAM;oBACNC,UAAU;oBACVM,cAAc;oBACdH,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQ+B,WAAWJ;oBAEvDzB,OAAO;wBACL2B,aAAanC,eACXS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQ+B,WAAWF;oBAEzD;gBACF;gBACA;oBACEP,MAAM;oBACNC,MAAM;oBACNC,UAAU;oBACVG,OAAOjC,eACLS,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQgC,QAAQL;oBAEpDG,cAAcvC,OAAO0C,MAAM;oBAC3BC,SAAS9B,OAAO+B,MAAM,CAAC5C,QAAQ6C,GAAG,CAAC,CAACJ,SAAY,CAAA;4BAC9CL,OAAOjC,eACLS,qBACA,CAACM,SACCX,YAAY,CAACW,OAAO,EAAET,QAAQgC,QAAQ,CAAC,GAAGA,OAAO,KAAK,CAAC,CAAC;4BAE5DK,OAAOL;wBACT,CAAA;oBACA9B,OAAO;wBACL2B,aAAalC,oBACXQ,qBACA,CAACM,SAAWX,YAAY,CAACW,OAAO,EAAET,QAAQgC,QAAQH;oBAEtD;gBACF;aACD;QACH;QACAS,YAAY;IACd;IAEA,OAAOhC;AACT,EAAE"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/permission-features/types.ts"],"sourcesContent":["import type { CollectionConfig, Field } from \"payload\";\nimport { STATUS } from \"../../lib/constants/permission-feature.js\";\n\nexport type PermissionFeaturesCollectionTranslations = {\n [locale: string]: {\n labels?: {\n singular?: string;\n plural?: string;\n };\n admin?: {\n group?: string;\n };\n fields?: {\n code?: {\n label?: string;\n placeholder?: string;\n };\n sortOrder?: {\n label?: string;\n placeholder?: string;\n };\n status?: {\n label?: string;\n placeholder?: string;\n activeLabel?: string;\n inactiveLabel?: string;\n };\n };\n };\n};\n\nexport type PermissionFeaturesCollectionParams = {\n translations?: PermissionFeaturesCollectionTranslations;\n fields?: Field[];\n access?: CollectionConfig[\"access\"];\n labels?: CollectionConfig[\"labels\"];\n admin?: CollectionConfig[\"admin\"];\n};\n\nexport type PermissionFeatureStatus = (typeof STATUS)[keyof typeof STATUS];\n\nexport type PermissionFeature = {\n id: string | number;\n code?: string | null;\n sortOrder?: number | null;\n status?: PermissionFeatureStatus | null;\n};\n"],"names":[],"mappings":"AAyCA,WAKE"}
@@ -0,0 +1,37 @@
1
+ export const permissionsDefaultTranslations = {
2
+ en: {
3
+ labels: {
4
+ singular: "Permission",
5
+ plural: "Permissions"
6
+ },
7
+ admin: {
8
+ group: "System"
9
+ },
10
+ fields: {
11
+ name: {
12
+ label: "Name",
13
+ placeholder: "Enter name"
14
+ },
15
+ permissionFeature: {
16
+ label: "Permission Feature",
17
+ placeholder: "Select permission feature"
18
+ },
19
+ permissionAction: {
20
+ label: "Permission Action",
21
+ placeholder: "Select permission action"
22
+ },
23
+ sortOrder: {
24
+ label: "Sort Order",
25
+ placeholder: "Enter sort order"
26
+ },
27
+ status: {
28
+ label: "Status",
29
+ placeholder: "Select status",
30
+ activeLabel: "Active",
31
+ inactiveLabel: "Inactive"
32
+ }
33
+ }
34
+ }
35
+ };
36
+
37
+ //# sourceMappingURL=default-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/permissions/default-data.ts"],"sourcesContent":["import type { PermissionsCollectionTranslations } from \"./types.js\";\n\nexport const permissionsDefaultTranslations: PermissionsCollectionTranslations =\n {\n en: {\n labels: {\n singular: \"Permission\",\n plural: \"Permissions\",\n },\n admin: {\n group: \"System\",\n },\n fields: {\n name: {\n label: \"Name\",\n placeholder: \"Enter name\",\n },\n permissionFeature: {\n label: \"Permission Feature\",\n placeholder: \"Select permission feature\",\n },\n permissionAction: {\n label: \"Permission Action\",\n placeholder: \"Select permission action\",\n },\n sortOrder: {\n label: \"Sort Order\",\n placeholder: \"Enter sort order\",\n },\n status: {\n label: \"Status\",\n placeholder: \"Select status\",\n activeLabel: \"Active\",\n inactiveLabel: \"Inactive\",\n },\n },\n },\n };\n"],"names":["permissionsDefaultTranslations","en","labels","singular","plural","admin","group","fields","name","label","placeholder","permissionFeature","permissionAction","sortOrder","status","activeLabel","inactiveLabel"],"mappings":"AAEA,OAAO,MAAMA,iCACX;IACEC,IAAI;QACFC,QAAQ;YACNC,UAAU;YACVC,QAAQ;QACV;QACAC,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACNC,MAAM;gBACJC,OAAO;gBACPC,aAAa;YACf;YACAC,mBAAmB;gBACjBF,OAAO;gBACPC,aAAa;YACf;YACAE,kBAAkB;gBAChBH,OAAO;gBACPC,aAAa;YACf;YACAG,WAAW;gBACTJ,OAAO;gBACPC,aAAa;YACf;YACAI,QAAQ;gBACNL,OAAO;gBACPC,aAAa;gBACbK,aAAa;gBACbC,eAAe;YACjB;QACF;IACF;AACF,EAAE"}