roles-privileges-payload-plugin 1.0.2 → 1.1.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 (51) hide show
  1. package/README.md +5 -1
  2. package/dist/collections/roles.d.ts +32 -0
  3. package/dist/collections/roles.js +122 -0
  4. package/dist/collections/roles.js.map +1 -0
  5. package/dist/components/PrivilegesSelect.d.ts +19 -0
  6. package/dist/components/PrivilegesSelect.js +471 -0
  7. package/dist/components/PrivilegesSelect.js.map +1 -0
  8. package/dist/exports/client.d.ts +2 -0
  9. package/dist/exports/client.js +3 -0
  10. package/dist/exports/client.js.map +1 -0
  11. package/dist/exports/rsc.d.ts +1 -0
  12. package/dist/exports/rsc.js +3 -0
  13. package/dist/exports/rsc.js.map +1 -0
  14. package/dist/exports/types.d.ts +3 -0
  15. package/dist/exports/types.js +5 -0
  16. package/dist/exports/types.js.map +1 -0
  17. package/dist/exports/utilities.d.ts +6 -0
  18. package/dist/exports/utilities.js +14 -0
  19. package/dist/exports/utilities.js.map +1 -0
  20. package/dist/index.d.ts +19 -0
  21. package/dist/index.js +179 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/roles-privileges-payload-plugin-1.1.1.tgz +0 -0
  24. package/dist/translations/index.d.ts +7 -0
  25. package/dist/translations/index.js +50 -0
  26. package/dist/translations/index.js.map +1 -0
  27. package/dist/translations/languages/en.d.ts +2 -0
  28. package/dist/translations/languages/en.js +76 -0
  29. package/dist/translations/languages/en.js.map +1 -0
  30. package/dist/translations/languages/fr.d.ts +2 -0
  31. package/dist/translations/languages/fr.js +76 -0
  32. package/dist/translations/languages/fr.js.map +1 -0
  33. package/dist/translations/types.d.ts +67 -0
  34. package/dist/translations/types.js +3 -0
  35. package/dist/translations/types.js.map +1 -0
  36. package/dist/utils/createCustomPrivilege.d.ts +89 -0
  37. package/dist/utils/createCustomPrivilege.js +77 -0
  38. package/dist/utils/createCustomPrivilege.js.map +1 -0
  39. package/dist/utils/generateGlobalPrivileges.d.ts +48 -0
  40. package/dist/utils/generateGlobalPrivileges.js +133 -0
  41. package/dist/utils/generateGlobalPrivileges.js.map +1 -0
  42. package/dist/utils/generatePrivileges.d.ts +51 -0
  43. package/dist/utils/generatePrivileges.js +162 -0
  44. package/dist/utils/generatePrivileges.js.map +1 -0
  45. package/dist/utils/privilegesAccess.d.ts +71 -0
  46. package/dist/utils/privilegesAccess.js +144 -0
  47. package/dist/utils/privilegesAccess.js.map +1 -0
  48. package/dist/utils/seedSuperAdminRole.d.ts +6 -0
  49. package/dist/utils/seedSuperAdminRole.js +60 -0
  50. package/dist/utils/seedSuperAdminRole.js.map +1 -0
  51. package/package.json +4 -1
package/dist/index.js ADDED
@@ -0,0 +1,179 @@
1
+ import { createRolesCollection } from './collections/roles.js';
2
+ import { translations } from './translations/index.js';
3
+ import { customPrivilegesRegistry } from './utils/createCustomPrivilege.js';
4
+ import { allGlobalPrivilegesMap, generateGlobalPrivilegeKey, generateGlobalPrivileges } from './utils/generateGlobalPrivileges.js';
5
+ import { allPrivilegesMap, generateCollectionPrivileges, generatePrivilegeKey } from './utils/generatePrivileges.js';
6
+ import { hasPrivilege } from './utils/privilegesAccess.js';
7
+ import { seedSuperAdminRole } from './utils/seedSuperAdminRole.js';
8
+ export * from './exports/types.js';
9
+ export * from './exports/utilities.js';
10
+ /* -------------------------------------------------------------------------- */ /* Helper Functions */ /* -------------------------------------------------------------------------- */ const wrapAccess = (original, privilegeKey)=>async (args)=>{
11
+ let originalResult = true;
12
+ if (original !== undefined) {
13
+ originalResult = typeof original === 'function' ? await original(args) : original;
14
+ if (originalResult === false) return false;
15
+ }
16
+ const hasPriv = await hasPrivilege(privilegeKey)(args);
17
+ if (!hasPriv) return false;
18
+ return originalResult;
19
+ };
20
+ function buildPrivilegesMap(autoMap, type, slugKey, labelKey) {
21
+ const map = new Map();
22
+ for (const entry of autoMap.values()){
23
+ map.set(entry[slugKey], {
24
+ [slugKey]: entry[slugKey],
25
+ [labelKey]: entry[labelKey],
26
+ privileges: {
27
+ ...entry.privileges
28
+ }
29
+ });
30
+ }
31
+ for (const custom of customPrivilegesRegistry.values()){
32
+ if (custom.type !== type) continue;
33
+ const existing = map.get(custom.slug);
34
+ if (existing) {
35
+ existing.privileges = {
36
+ ...existing.privileges,
37
+ ...custom.privileges
38
+ };
39
+ } else {
40
+ map.set(custom.slug, {
41
+ [slugKey]: custom.slug,
42
+ [labelKey]: custom.label,
43
+ privileges: {
44
+ ...custom.privileges
45
+ }
46
+ });
47
+ }
48
+ }
49
+ return Array.from(map.values());
50
+ }
51
+ /* -------------------------------------------------------------------------- */ /* Plugin */ /* -------------------------------------------------------------------------- */ export const rolesPrivilegesPayloadPlugin = (pluginOptions = {})=>(config)=>{
52
+ const { enable = true, excludeCollections = [], excludeGlobals = [], wrapCollectionAccess = true, wrapGlobalAccess = true, seedSuperAdmin = true } = pluginOptions;
53
+ if (!enable) {
54
+ return config;
55
+ }
56
+ config.collections ??= [];
57
+ config.globals ??= [];
58
+ /* ---------------------------------------------------------------------- */ /* Generate initial privileges */ /* ---------------------------------------------------------------------- */ for (const collection of config.collections){
59
+ if (!excludeCollections.includes(collection.slug) && collection.slug !== 'roles') {
60
+ generateCollectionPrivileges(collection);
61
+ }
62
+ }
63
+ for (const global of config.globals){
64
+ if (!excludeGlobals.includes(global.slug)) {
65
+ generateGlobalPrivileges(global);
66
+ }
67
+ }
68
+ /* ---------------------------------------------------------------------- */ /* Roles collection */ /* ---------------------------------------------------------------------- */ const rolesCollectionToAdd = pluginOptions.customRolesCollection || createRolesCollection([], []);
69
+ // Ensure the custom collection has slug 'roles'
70
+ if (rolesCollectionToAdd.slug !== 'roles') {
71
+ throw new Error('[Roles & Privileges Plugin] Custom roles collection must have slug "roles"');
72
+ }
73
+ config.collections.push(rolesCollectionToAdd);
74
+ const rolesCollection = config.collections.find((c)=>c.slug === 'roles');
75
+ if (rolesCollection) {
76
+ generateCollectionPrivileges(rolesCollection);
77
+ const privilegesField = rolesCollection.fields.find((f)=>'name' in f && f.name === 'privileges');
78
+ if (privilegesField && 'admin' in privilegesField && privilegesField.admin?.components?.Field) {
79
+ const fieldComponent = privilegesField.admin.components.Field;
80
+ if (typeof fieldComponent === 'object' && 'clientProps' in fieldComponent) {
81
+ fieldComponent.clientProps = {
82
+ get collections () {
83
+ return buildPrivilegesMap(allPrivilegesMap, 'collection', 'collectionSlug', 'collectionLabel');
84
+ },
85
+ get globals () {
86
+ return buildPrivilegesMap(allGlobalPrivilegesMap, 'global', 'globalSlug', 'globalLabel');
87
+ }
88
+ };
89
+ }
90
+ }
91
+ }
92
+ if (pluginOptions.disabled) {
93
+ return config;
94
+ }
95
+ /* ---------------------------------------------------------------------- */ /* Collection access wrapping */ /* ---------------------------------------------------------------------- */ const COLLECTION_ACTIONS = [
96
+ 'create',
97
+ 'read',
98
+ 'update',
99
+ 'delete',
100
+ 'admin',
101
+ 'readVersions',
102
+ 'unlock'
103
+ ];
104
+ if (wrapCollectionAccess) {
105
+ for (const collection of config.collections){
106
+ if (excludeCollections.includes(collection.slug) || collection.slug === 'roles') {
107
+ continue;
108
+ }
109
+ collection.access ??= {};
110
+ const originalAccess = {
111
+ ...collection.access
112
+ };
113
+ for (const action of COLLECTION_ACTIONS){
114
+ const key = generatePrivilegeKey(collection.slug, action);
115
+ collection.access[action] = wrapAccess(originalAccess[action], key);
116
+ }
117
+ }
118
+ }
119
+ /* ---------------------------------------------------------------------- */ /* Global access wrapping */ /* ---------------------------------------------------------------------- */ const GLOBAL_ACTIONS = [
120
+ 'read',
121
+ 'update',
122
+ 'readDrafts',
123
+ 'readVersions'
124
+ ];
125
+ if (wrapGlobalAccess) {
126
+ for (const global of config.globals){
127
+ if (excludeGlobals.includes(global.slug)) continue;
128
+ global.access ??= {};
129
+ const originalAccess = {
130
+ ...global.access
131
+ };
132
+ for (const action of GLOBAL_ACTIONS){
133
+ const key = generateGlobalPrivilegeKey(global.slug, action);
134
+ global.access[action] = wrapAccess(originalAccess[action], key);
135
+ }
136
+ }
137
+ }
138
+ /* ---------------------------------------------------------------------- */ /* onInit */ /* ---------------------------------------------------------------------- */ const incomingOnInit = config.onInit;
139
+ config.onInit = async (payload)=>{
140
+ if (incomingOnInit) {
141
+ await incomingOnInit(payload);
142
+ }
143
+ const existingCollections = new Set(allPrivilegesMap.keys());
144
+ for (const slug of Object.keys(payload.collections)){
145
+ if (existingCollections.has(slug) || excludeCollections.includes(slug) || slug === 'payload-preferences' || slug === 'payload-migrations' || slug === 'payload-locked-documents') {
146
+ continue;
147
+ }
148
+ const collection = payload.collections[slug];
149
+ if (collection?.config) {
150
+ payload.logger.info(`[Roles & Privileges] Discovered late-loaded collection: ${slug}`);
151
+ generateCollectionPrivileges(collection.config);
152
+ }
153
+ }
154
+ const existingGlobals = new Set(allGlobalPrivilegesMap.keys());
155
+ for (const slug of Object.keys(payload.globals)){
156
+ if (existingGlobals.has(slug) || excludeGlobals.includes(slug)) continue;
157
+ const global = payload.globals[slug];
158
+ if (global?.config) {
159
+ payload.logger.info(`[Roles & Privileges] Discovered late-loaded global: ${slug}`);
160
+ generateGlobalPrivileges(global.config);
161
+ }
162
+ }
163
+ if (seedSuperAdmin) {
164
+ await seedSuperAdminRole(payload);
165
+ }
166
+ };
167
+ /* ---------------------------------------------------------------------- */ /* Translations */ /* ---------------------------------------------------------------------- */ config.i18n ??= {};
168
+ config.i18n.translations ??= {};
169
+ for (const locale of Object.keys(translations)){
170
+ const pluginBlock = translations[locale]['plugin-roles-privileges'];
171
+ config.i18n.translations[locale] ??= {};
172
+ config.i18n.translations[locale]['plugin-roles-privileges'] = {
173
+ ...pluginBlock
174
+ };
175
+ }
176
+ return config;
177
+ };
178
+
179
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\nimport type { CollectionConfig, Config } from 'payload'\n\nimport { createRolesCollection } from './collections/roles.js'\nimport { translations } from './translations/index.js'\nimport type { PluginDefaultTranslationsObject } from './translations/types.js'\n\nimport type { PayloadRequest, Where } from 'payload'\nimport { customPrivilegesRegistry } from './utils/createCustomPrivilege.js'\nimport {\n allGlobalPrivilegesMap,\n generateGlobalPrivilegeKey,\n generateGlobalPrivileges,\n} from './utils/generateGlobalPrivileges.js'\nimport {\n allPrivilegesMap,\n generateCollectionPrivileges,\n generatePrivilegeKey,\n} from './utils/generatePrivileges.js'\nimport { hasPrivilege } from './utils/privilegesAccess.js'\nimport { seedSuperAdminRole } from './utils/seedSuperAdminRole.js'\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\nexport type RolesPrivilegesPayloadPluginConfig = {\n enable?: boolean\n disabled?: boolean\n excludeCollections?: string[]\n excludeGlobals?: string[]\n wrapCollectionAccess?: boolean\n wrapGlobalAccess?: boolean\n seedSuperAdmin?: boolean\n /**\n * Custom roles collection configuration.\n * If provided, this collection will be used instead of the default one.\n * Use `createRolesCollection` helper to create a base configuration and customize it.\n */\n customRolesCollection?: CollectionConfig\n}\n\nexport * from './exports/types.js'\nexport * from './exports/utilities.js'\n\ntype AccessArgs = {\n req: PayloadRequest\n [key: string]: any\n}\n\ntype AccessResult = boolean | Where\ntype AccessFn = (args: AccessArgs) => AccessResult | Promise<AccessResult>\n\n/* -------------------------------------------------------------------------- */\n/* Helper Functions */\n/* -------------------------------------------------------------------------- */\n\nconst wrapAccess =\n (\n original: AccessFn | AccessResult | undefined,\n privilegeKey: string,\n ): ((args: AccessArgs) => Promise<boolean | Where>) =>\n async (args) => {\n let originalResult: AccessResult = true\n\n if (original !== undefined) {\n originalResult = typeof original === 'function' ? await original(args) : original\n\n if (originalResult === false) return false\n }\n\n const hasPriv = await hasPrivilege(privilegeKey)(args)\n if (!hasPriv) return false\n\n return originalResult\n }\n\nfunction buildPrivilegesMap(\n autoMap: Map<string, any>,\n type: 'collection' | 'global',\n slugKey: 'collectionSlug' | 'globalSlug',\n labelKey: 'collectionLabel' | 'globalLabel',\n) {\n const map = new Map<string, any>()\n\n for (const entry of autoMap.values()) {\n map.set(entry[slugKey], {\n [slugKey]: entry[slugKey],\n [labelKey]: entry[labelKey],\n privileges: { ...entry.privileges },\n })\n }\n\n for (const custom of customPrivilegesRegistry.values()) {\n if (custom.type !== type) continue\n\n const existing = map.get(custom.slug)\n if (existing) {\n existing.privileges = {\n ...existing.privileges,\n ...custom.privileges,\n }\n } else {\n map.set(custom.slug, {\n [slugKey]: custom.slug,\n [labelKey]: custom.label,\n privileges: { ...custom.privileges },\n })\n }\n }\n\n return Array.from(map.values())\n}\n\n/* -------------------------------------------------------------------------- */\n/* Plugin */\n/* -------------------------------------------------------------------------- */\n\nexport const rolesPrivilegesPayloadPlugin =\n (pluginOptions: RolesPrivilegesPayloadPluginConfig = {}) =>\n (config: Config): Config => {\n const {\n enable = true,\n excludeCollections = [],\n excludeGlobals = [],\n wrapCollectionAccess = true,\n wrapGlobalAccess = true,\n seedSuperAdmin = true,\n } = pluginOptions\n\n if (!enable) {\n return config\n }\n\n config.collections ??= []\n config.globals ??= []\n\n /* ---------------------------------------------------------------------- */\n /* Generate initial privileges */\n /* ---------------------------------------------------------------------- */\n\n for (const collection of config.collections) {\n if (!excludeCollections.includes(collection.slug) && collection.slug !== 'roles') {\n generateCollectionPrivileges(collection)\n }\n }\n\n for (const global of config.globals) {\n if (!excludeGlobals.includes(global.slug)) {\n generateGlobalPrivileges(global)\n }\n }\n\n /* ---------------------------------------------------------------------- */\n /* Roles collection */\n /* ---------------------------------------------------------------------- */\n\n const rolesCollectionToAdd =\n pluginOptions.customRolesCollection || createRolesCollection([], [])\n\n // Ensure the custom collection has slug 'roles'\n if (rolesCollectionToAdd.slug !== 'roles') {\n throw new Error('[Roles & Privileges Plugin] Custom roles collection must have slug \"roles\"')\n }\n\n config.collections.push(rolesCollectionToAdd)\n\n const rolesCollection = config.collections.find((c) => c.slug === 'roles')\n\n if (rolesCollection) {\n generateCollectionPrivileges(rolesCollection)\n\n const privilegesField = rolesCollection.fields.find(\n (f) => 'name' in f && f.name === 'privileges',\n )\n\n if (\n privilegesField &&\n 'admin' in privilegesField &&\n privilegesField.admin?.components?.Field\n ) {\n const fieldComponent = privilegesField.admin.components.Field\n\n if (typeof fieldComponent === 'object' && 'clientProps' in fieldComponent) {\n fieldComponent.clientProps = {\n get collections() {\n return buildPrivilegesMap(\n allPrivilegesMap,\n 'collection',\n 'collectionSlug',\n 'collectionLabel',\n )\n },\n get globals() {\n return buildPrivilegesMap(\n allGlobalPrivilegesMap,\n 'global',\n 'globalSlug',\n 'globalLabel',\n )\n },\n }\n }\n }\n }\n\n if (pluginOptions.disabled) {\n return config\n }\n\n /* ---------------------------------------------------------------------- */\n /* Collection access wrapping */\n /* ---------------------------------------------------------------------- */\n\n const COLLECTION_ACTIONS = [\n 'create',\n 'read',\n 'update',\n 'delete',\n 'admin',\n 'readVersions',\n 'unlock',\n ] as const\n\n if (wrapCollectionAccess) {\n for (const collection of config.collections) {\n if (excludeCollections.includes(collection.slug) || collection.slug === 'roles') {\n continue\n }\n\n collection.access ??= {}\n const originalAccess = { ...collection.access }\n\n for (const action of COLLECTION_ACTIONS) {\n const key = generatePrivilegeKey(collection.slug, action)\n collection.access[action] = wrapAccess(originalAccess[action], key) as any\n }\n }\n }\n\n /* ---------------------------------------------------------------------- */\n /* Global access wrapping */\n /* ---------------------------------------------------------------------- */\n\n const GLOBAL_ACTIONS = ['read', 'update', 'readDrafts', 'readVersions'] as const\n\n if (wrapGlobalAccess) {\n for (const global of config.globals) {\n if (excludeGlobals.includes(global.slug)) continue\n\n global.access ??= {}\n const originalAccess = { ...global.access }\n\n for (const action of GLOBAL_ACTIONS) {\n const key = generateGlobalPrivilegeKey(global.slug, action)\n global.access[action] = wrapAccess(originalAccess[action], key) as any\n }\n }\n }\n\n /* ---------------------------------------------------------------------- */\n /* onInit */\n /* ---------------------------------------------------------------------- */\n\n const incomingOnInit = config.onInit\n\n config.onInit = async (payload) => {\n if (incomingOnInit) {\n await incomingOnInit(payload)\n }\n\n const existingCollections = new Set(allPrivilegesMap.keys())\n\n for (const slug of Object.keys(payload.collections)) {\n if (\n existingCollections.has(slug) ||\n excludeCollections.includes(slug) ||\n slug === 'payload-preferences' ||\n slug === 'payload-migrations' ||\n slug === 'payload-locked-documents'\n ) {\n continue\n }\n\n const collection = payload.collections[slug]\n if (collection?.config) {\n payload.logger.info(`[Roles & Privileges] Discovered late-loaded collection: ${slug}`)\n generateCollectionPrivileges(collection.config)\n }\n }\n\n const existingGlobals = new Set(allGlobalPrivilegesMap.keys())\n\n for (const slug of Object.keys(payload.globals)) {\n if (existingGlobals.has(slug) || excludeGlobals.includes(slug)) continue\n\n const global = (payload.globals as any)[slug]\n if (global?.config) {\n payload.logger.info(`[Roles & Privileges] Discovered late-loaded global: ${slug}`)\n generateGlobalPrivileges(global.config)\n }\n }\n\n if (seedSuperAdmin) {\n await seedSuperAdminRole(payload)\n }\n }\n\n /* ---------------------------------------------------------------------- */\n /* Translations */\n /* ---------------------------------------------------------------------- */\n\n config.i18n ??= {}\n config.i18n.translations ??= {}\n\n for (const locale of Object.keys(translations) as AcceptedLanguages[]) {\n const pluginBlock = translations[locale]['plugin-roles-privileges']\n\n config.i18n.translations[locale] ??= {}\n ;(config.i18n.translations[locale] as PluginDefaultTranslationsObject)[\n 'plugin-roles-privileges'\n ] = {\n ...pluginBlock,\n }\n }\n\n return config\n }\n"],"names":["createRolesCollection","translations","customPrivilegesRegistry","allGlobalPrivilegesMap","generateGlobalPrivilegeKey","generateGlobalPrivileges","allPrivilegesMap","generateCollectionPrivileges","generatePrivilegeKey","hasPrivilege","seedSuperAdminRole","wrapAccess","original","privilegeKey","args","originalResult","undefined","hasPriv","buildPrivilegesMap","autoMap","type","slugKey","labelKey","map","Map","entry","values","set","privileges","custom","existing","get","slug","label","Array","from","rolesPrivilegesPayloadPlugin","pluginOptions","config","enable","excludeCollections","excludeGlobals","wrapCollectionAccess","wrapGlobalAccess","seedSuperAdmin","collections","globals","collection","includes","global","rolesCollectionToAdd","customRolesCollection","Error","push","rolesCollection","find","c","privilegesField","fields","f","name","admin","components","Field","fieldComponent","clientProps","disabled","COLLECTION_ACTIONS","access","originalAccess","action","key","GLOBAL_ACTIONS","incomingOnInit","onInit","payload","existingCollections","Set","keys","Object","has","logger","info","existingGlobals","i18n","locale","pluginBlock"],"mappings":"AAGA,SAASA,qBAAqB,QAAQ,yBAAwB;AAC9D,SAASC,YAAY,QAAQ,0BAAyB;AAItD,SAASC,wBAAwB,QAAQ,mCAAkC;AAC3E,SACEC,sBAAsB,EACtBC,0BAA0B,EAC1BC,wBAAwB,QACnB,sCAAqC;AAC5C,SACEC,gBAAgB,EAChBC,4BAA4B,EAC5BC,oBAAoB,QACf,gCAA+B;AACtC,SAASC,YAAY,QAAQ,8BAA6B;AAC1D,SAASC,kBAAkB,QAAQ,gCAA+B;AAqBlE,cAAc,qBAAoB;AAClC,cAAc,yBAAwB;AAUtC,8EAA8E,GAC9E,+EAA+E,GAC/E,8EAA8E,GAE9E,MAAMC,aACJ,CACEC,UACAC,eAEF,OAAOC;QACL,IAAIC,iBAA+B;QAEnC,IAAIH,aAAaI,WAAW;YAC1BD,iBAAiB,OAAOH,aAAa,aAAa,MAAMA,SAASE,QAAQF;YAEzE,IAAIG,mBAAmB,OAAO,OAAO;QACvC;QAEA,MAAME,UAAU,MAAMR,aAAaI,cAAcC;QACjD,IAAI,CAACG,SAAS,OAAO;QAErB,OAAOF;IACT;AAEF,SAASG,mBACPC,OAAyB,EACzBC,IAA6B,EAC7BC,OAAwC,EACxCC,QAA2C;IAE3C,MAAMC,MAAM,IAAIC;IAEhB,KAAK,MAAMC,SAASN,QAAQO,MAAM,GAAI;QACpCH,IAAII,GAAG,CAACF,KAAK,CAACJ,QAAQ,EAAE;YACtB,CAACA,QAAQ,EAAEI,KAAK,CAACJ,QAAQ;YACzB,CAACC,SAAS,EAAEG,KAAK,CAACH,SAAS;YAC3BM,YAAY;gBAAE,GAAGH,MAAMG,UAAU;YAAC;Q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BAC5C,IAAIe,YAAYT,QAAQ;oBACtBqC,QAAQM,MAAM,CAACC,IAAI,CAAC,CAAC,wDAAwD,EAAElD,MAAM;oBACrFzB,6BAA6BwC,WAAWT,MAAM;gBAChD;YACF;YAEA,MAAM6C,kBAAkB,IAAIN,IAAI1E,uBAAuB2E,IAAI;YAE3D,KAAK,MAAM9C,QAAQ+C,OAAOD,IAAI,CAACH,QAAQ7B,OAAO,EAAG;gBAC/C,IAAIqC,gBAAgBH,GAAG,CAAChD,SAASS,eAAeO,QAAQ,CAAChB,OAAO;gBAEhE,MAAMiB,SAAS,AAAC0B,QAAQ7B,OAAO,AAAQ,CAACd,KAAK;gBAC7C,IAAIiB,QAAQX,QAAQ;oBAClBqC,QAAQM,MAAM,CAACC,IAAI,CAAC,CAAC,oDAAoD,EAAElD,MAAM;oBACjF3B,yBAAyB4C,OAAOX,MAAM;gBACxC;YACF;YAEA,IAAIM,gBAAgB;gBAClB,MAAMlC,mBAAmBiE;YAC3B;QACF;QAEA,0EAA0E,GAC1E,6EAA6E,GAC7E,0EAA0E,GAE1ErC,OAAO8C,IAAI,KAAK,CAAC;QACjB9C,OAAO8C,IAAI,CAACnF,YAAY,KAAK,CAAC;QAE9B,KAAK,MAAMoF,UAAUN,OAAOD,IAAI,CAAC7E,cAAsC;YACrE,MAAMqF,cAAcrF,YAAY,CAACoF,OAAO,CAAC,0BAA0B;YAEnE/C,OAAO8C,IAAI,CAACnF,YAAY,CAACoF,OAAO,KAAK,CAAC;YACpC/C,OAAO8C,IAAI,CAACnF,YAAY,CAACoF,OAAO,AAAoC,CACpE,0BACD,GAAG;gBACF,GAAGC,WAAW;YAChB;QACF;QAEA,OAAOhD;IACT,EAAC"}
@@ -0,0 +1,7 @@
1
+ import type { GenericTranslationsObject } from '@payloadcms/translations';
2
+ import type { PluginDefaultTranslationsObject } from './types.js';
3
+ type TranslationMap = {
4
+ [key: string]: GenericTranslationsObject & PluginDefaultTranslationsObject;
5
+ };
6
+ export declare const translations: TranslationMap;
7
+ export {};
@@ -0,0 +1,50 @@
1
+ import { enTranslations } from './languages/en.js';
2
+ import { frTranslations } from './languages/fr.js';
3
+ export const translations = {
4
+ ar: enTranslations,
5
+ az: enTranslations,
6
+ bg: enTranslations,
7
+ ca: enTranslations,
8
+ cs: enTranslations,
9
+ da: enTranslations,
10
+ de: enTranslations,
11
+ en: enTranslations,
12
+ es: enTranslations,
13
+ et: enTranslations,
14
+ fa: enTranslations,
15
+ fr: frTranslations,
16
+ he: enTranslations,
17
+ hr: enTranslations,
18
+ hu: enTranslations,
19
+ hy: enTranslations,
20
+ id: enTranslations,
21
+ is: enTranslations,
22
+ it: enTranslations,
23
+ ja: enTranslations,
24
+ ko: enTranslations,
25
+ lt: enTranslations,
26
+ lv: enTranslations,
27
+ my: enTranslations,
28
+ nb: enTranslations,
29
+ nl: enTranslations,
30
+ pl: enTranslations,
31
+ pt: enTranslations,
32
+ ro: enTranslations,
33
+ rs: enTranslations,
34
+ rsLatin: enTranslations,
35
+ ru: enTranslations,
36
+ sk: enTranslations,
37
+ sl: enTranslations,
38
+ sv: enTranslations,
39
+ ta: enTranslations,
40
+ th: enTranslations,
41
+ tr: enTranslations,
42
+ uk: enTranslations,
43
+ vi: enTranslations,
44
+ zh: enTranslations,
45
+ zhTw: enTranslations,
46
+ bnBd: enTranslations,
47
+ bnIn: enTranslations
48
+ };
49
+
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/translations/index.ts"],"sourcesContent":["import type { GenericTranslationsObject } from '@payloadcms/translations'\nimport type { PluginDefaultTranslationsObject } from './types.js'\n\nimport { enTranslations } from './languages/en.js'\nimport { frTranslations } from './languages/fr.js'\n\ntype TranslationMap = {\n [key: string]: GenericTranslationsObject & PluginDefaultTranslationsObject\n}\n\nexport const translations: TranslationMap = {\n ar: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n az: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n bg: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n ca: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n cs: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n da: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n de: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n en: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n es: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n et: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n fa: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n fr: frTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n he: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n hr: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n hu: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n hy: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n id: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n is: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n it: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n ja: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n ko: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n lt: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n lv: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n my: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n nb: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n nl: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n pl: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n pt: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n ro: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n rs: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n rsLatin: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n ru: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n sk: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n sl: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n sv: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n ta: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n th: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n tr: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n uk: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n vi: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n zh: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n zhTw: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n bnBd: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n bnIn: enTranslations as GenericTranslationsObject & PluginDefaultTranslationsObject,\n}\n"],"names":["enTranslations","frTranslations","translations","ar","az","bg","ca","cs","da","de","en","es","et","fa","fr","he","hr","hu","hy","id","is","it","ja","ko","lt","lv","my","nb","nl","pl","pt","ro","rs","rsLatin","ru","sk","sl","sv","ta","th","tr","uk","vi","zh","zhTw","bnBd","bnIn"],"mappings":"AAGA,SAASA,cAAc,QAAQ,oBAAmB;AAClD,SAASC,cAAc,QAAQ,oBAAmB;AAMlD,OAAO,MAAMC,eAA+B;IAC1CC,IAAIH;IACJI,IAAIJ;IACJK,IAAIL;IACJM,IAAIN;IACJO,IAAIP;IACJQ,IAAIR;IACJS,IAAIT;IACJU,IAAIV;IACJW,IAAIX;IACJY,IAAIZ;IACJa,IAAIb;IACJc,IAAIb;IACJc,IAAIf;IACJgB,IAAIhB;IACJiB,IAAIjB;IACJkB,IAAIlB;IACJmB,IAAInB;IACJoB,IAAIpB;IACJqB,IAAIrB;IACJsB,IAAItB;IACJuB,IAAIvB;IACJwB,IAAIxB;IACJyB,IAAIzB;IACJ0B,IAAI1B;IACJ2B,IAAI3B;IACJ4B,IAAI5B;IACJ6B,IAAI7B;IACJ8B,IAAI9B;IACJ+B,IAAI/B;IACJgC,IAAIhC;IACJiC,SAASjC;IACTkC,IAAIlC;IACJmC,IAAInC;IACJoC,IAAIpC;IACJqC,IAAIrC;IACJsC,IAAItC;IACJuC,IAAIvC;IACJwC,IAAIxC;IACJyC,IAAIzC;IACJ0C,IAAI1C;IACJ2C,IAAI3C;IACJ4C,MAAM5C;IACN6C,MAAM7C;IACN8C,MAAM9C;AACR,EAAC"}
@@ -0,0 +1,2 @@
1
+ import type { PluginTranslations } from '../types.js';
2
+ export declare const enTranslations: PluginTranslations;
@@ -0,0 +1,76 @@
1
+ export const enTranslations = {
2
+ 'plugin-roles-privileges': {
3
+ // Roles collection
4
+ 'roles-collection-label-singular': 'Role',
5
+ 'roles-collection-label-plural': 'Roles',
6
+ 'roles-field-title-label': 'Role Title',
7
+ 'roles-field-slug-label': 'Slug',
8
+ 'roles-field-slug-description': 'Unique identifier for this role',
9
+ 'roles-field-privileges-label': 'Privileges',
10
+ 'roles-field-privileges-description': 'Select the privileges this role should have',
11
+ 'roles-field-description-label': 'Description',
12
+ 'roles-field-description-description': 'Optional description of this role',
13
+ // Privileges UI
14
+ 'privileges-column-collections-globals': 'Collections & Globals',
15
+ 'privileges-column-privileges': 'Privileges',
16
+ 'privileges-column-description': 'Description',
17
+ 'privileges-select-placeholder': 'Select a collection or global to view privileges',
18
+ 'privileges-select-privilege-placeholder': 'Select a privilege to view its description',
19
+ 'privileges-selected-count': 'Selected Privileges',
20
+ // Privilege operations
21
+ 'privilege-operation-create': 'Create',
22
+ 'privilege-operation-read': 'Read',
23
+ 'privilege-operation-update': 'Update',
24
+ 'privilege-operation-delete': 'Delete',
25
+ // Collection privilege operation prefixes
26
+ 'privilege-prefix-admin': 'Admin Access to',
27
+ 'privilege-prefix-create': 'Create',
28
+ 'privilege-prefix-read': 'Read',
29
+ 'privilege-prefix-readVersions': 'Read Versions:',
30
+ 'privilege-prefix-update': 'Update',
31
+ 'privilege-prefix-delete': 'Delete',
32
+ 'privilege-prefix-unlock': 'Unlock',
33
+ // Collection privilege description templates
34
+ 'privilege-template-admin': 'Access the {label} admin panel and UI',
35
+ 'privilege-template-admin-plural': 'true',
36
+ 'privilege-template-create': 'Ability to create new {label}',
37
+ 'privilege-template-create-plural': 'true',
38
+ 'privilege-template-read': 'View {label} content and information',
39
+ 'privilege-template-read-plural': 'false',
40
+ 'privilege-template-readVersions': 'Access and view previous versions of {label}',
41
+ 'privilege-template-readVersions-plural': 'true',
42
+ 'privilege-template-update': 'Modify existing {label} data',
43
+ 'privilege-template-update-plural': 'false',
44
+ 'privilege-template-delete': 'Remove {label} from the system',
45
+ 'privilege-template-delete-plural': 'true',
46
+ 'privilege-template-unlock': 'Unlock {label} that are being edited by other users',
47
+ 'privilege-template-unlock-plural': 'true',
48
+ // Global privilege operation prefixes
49
+ 'privilege-prefix-global-read': 'Read',
50
+ 'privilege-prefix-global-readDrafts': 'Read Drafts:',
51
+ 'privilege-prefix-global-readVersions': 'Read Versions:',
52
+ 'privilege-prefix-global-update': 'Update',
53
+ // Global privilege description templates
54
+ 'privilege-template-global-read': 'View {label} content and settings',
55
+ 'privilege-template-global-readDrafts': 'Access and view draft versions of {label}',
56
+ 'privilege-template-global-readVersions': 'Access and view previous versions of {label}',
57
+ 'privilege-template-global-update': 'Modify {label} settings and data',
58
+ // Collection/Global description templates
59
+ 'privilege-collection-description': 'Manage {label} in the system',
60
+ 'privilege-global-description': 'Manage {label} global settings',
61
+ // Privilege descriptions
62
+ 'privilege-description-collection-create': 'Allows create operations on {{collection}} collection',
63
+ 'privilege-description-collection-read': 'Allows read operations on {{collection}} collection',
64
+ 'privilege-description-collection-update': 'Allows update operations on {{collection}} collection',
65
+ 'privilege-description-collection-delete': 'Allows delete operations on {{collection}} collection',
66
+ 'privilege-description-global-read': 'Allows read access to {{global}} global',
67
+ 'privilege-description-global-update': 'Allows update access to {{global}} global',
68
+ 'privilege-description-collection-info': 'Manage access privileges for this collection',
69
+ 'privilege-description-global-info': 'Manage access privileges for this global',
70
+ // Errors
71
+ 'error-cannot-delete-super-admin': 'Cannot delete the Super Admin role',
72
+ 'error-cannot-modify-super-admin-slug': 'Cannot modify the Super Admin role slug'
73
+ }
74
+ };
75
+
76
+ //# sourceMappingURL=en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/translations/languages/en.ts"],"sourcesContent":["import type { PluginTranslations } from '../types.js'\n\nexport const enTranslations: PluginTranslations = {\n 'plugin-roles-privileges': {\n // Roles collection\n 'roles-collection-label-singular': 'Role',\n 'roles-collection-label-plural': 'Roles',\n 'roles-field-title-label': 'Role Title',\n 'roles-field-slug-label': 'Slug',\n 'roles-field-slug-description': 'Unique identifier for this role',\n 'roles-field-privileges-label': 'Privileges',\n 'roles-field-privileges-description': 'Select the privileges this role should have',\n 'roles-field-description-label': 'Description',\n 'roles-field-description-description': 'Optional description of this role',\n\n // Privileges UI\n 'privileges-column-collections-globals': 'Collections & Globals',\n 'privileges-column-privileges': 'Privileges',\n 'privileges-column-description': 'Description',\n 'privileges-select-placeholder': 'Select a collection or global to view privileges',\n 'privileges-select-privilege-placeholder': 'Select a privilege to view its description',\n 'privileges-selected-count': 'Selected Privileges',\n\n // Privilege operations\n 'privilege-operation-create': 'Create',\n 'privilege-operation-read': 'Read',\n 'privilege-operation-update': 'Update',\n 'privilege-operation-delete': 'Delete',\n\n // Collection privilege operation prefixes\n 'privilege-prefix-admin': 'Admin Access to',\n 'privilege-prefix-create': 'Create',\n 'privilege-prefix-read': 'Read',\n 'privilege-prefix-readVersions': 'Read Versions:',\n 'privilege-prefix-update': 'Update',\n 'privilege-prefix-delete': 'Delete',\n 'privilege-prefix-unlock': 'Unlock',\n\n // Collection privilege description templates\n 'privilege-template-admin': 'Access the {label} admin panel and UI',\n 'privilege-template-admin-plural': 'true',\n 'privilege-template-create': 'Ability to create new {label}',\n 'privilege-template-create-plural': 'true',\n 'privilege-template-read': 'View {label} content and information',\n 'privilege-template-read-plural': 'false',\n 'privilege-template-readVersions': 'Access and view previous versions of {label}',\n 'privilege-template-readVersions-plural': 'true',\n 'privilege-template-update': 'Modify existing {label} data',\n 'privilege-template-update-plural': 'false',\n 'privilege-template-delete': 'Remove {label} from the system',\n 'privilege-template-delete-plural': 'true',\n 'privilege-template-unlock': 'Unlock {label} that are being edited by other users',\n 'privilege-template-unlock-plural': 'true',\n\n // Global privilege operation prefixes\n 'privilege-prefix-global-read': 'Read',\n 'privilege-prefix-global-readDrafts': 'Read Drafts:',\n 'privilege-prefix-global-readVersions': 'Read Versions:',\n 'privilege-prefix-global-update': 'Update',\n\n // Global privilege description templates\n 'privilege-template-global-read': 'View {label} content and settings',\n 'privilege-template-global-readDrafts': 'Access and view draft versions of {label}',\n 'privilege-template-global-readVersions': 'Access and view previous versions of {label}',\n 'privilege-template-global-update': 'Modify {label} settings and data',\n\n // Collection/Global description templates\n 'privilege-collection-description': 'Manage {label} in the system',\n 'privilege-global-description': 'Manage {label} global settings',\n\n // Privilege descriptions\n 'privilege-description-collection-create':\n 'Allows create operations on {{collection}} collection',\n 'privilege-description-collection-read': 'Allows read operations on {{collection}} collection',\n 'privilege-description-collection-update':\n 'Allows update operations on {{collection}} collection',\n 'privilege-description-collection-delete':\n 'Allows delete operations on {{collection}} collection',\n 'privilege-description-global-read': 'Allows read access to {{global}} global',\n 'privilege-description-global-update': 'Allows update access to {{global}} global',\n 'privilege-description-collection-info': 'Manage access privileges for this collection',\n 'privilege-description-global-info': 'Manage access privileges for this global',\n\n // Errors\n 'error-cannot-delete-super-admin': 'Cannot delete the Super Admin role',\n 'error-cannot-modify-super-admin-slug': 'Cannot modify the Super Admin role slug',\n },\n}\n"],"names":["enTranslations"],"mappings":"AAEA,OAAO,MAAMA,iBAAqC;IAChD,2BAA2B;QACzB,mBAAmB;QACnB,mCAAmC;QACnC,iCAAiC;QACjC,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,gCAAgC;QAChC,sCAAsC;QACtC,iCAAiC;QACjC,uCAAuC;QAEvC,gBAAgB;QAChB,yCAAyC;QACzC,gCAAgC;QAChC,iCAAiC;QACjC,iCAAiC;QACjC,2CAA2C;QAC3C,6BAA6B;QAE7B,uBAAuB;QACvB,8BAA8B;QAC9B,4BAA4B;QAC5B,8BAA8B;QAC9B,8BAA8B;QAE9B,0CAA0C;QAC1C,0BAA0B;QAC1B,2BAA2B;QAC3B,yBAAyB;QACzB,iCAAiC;QACjC,2BAA2B;QAC3B,2BAA2B;QAC3B,2BAA2B;QAE3B,6CAA6C;QAC7C,4BAA4B;QAC5B,mCAAmC;QACnC,6BAA6B;QAC7B,oCAAoC;QACpC,2BAA2B;QAC3B,kCAAkC;QAClC,mCAAmC;QACnC,0CAA0C;QAC1C,6BAA6B;QAC7B,oCAAoC;QACpC,6BAA6B;QAC7B,oCAAoC;QACpC,6BAA6B;QAC7B,oCAAoC;QAEpC,sCAAsC;QACtC,gCAAgC;QAChC,sCAAsC;QACtC,wCAAwC;QACxC,kCAAkC;QAElC,yCAAyC;QACzC,kCAAkC;QAClC,wCAAwC;QACxC,0CAA0C;QAC1C,oCAAoC;QAEpC,0CAA0C;QAC1C,oCAAoC;QACpC,gCAAgC;QAEhC,yBAAyB;QACzB,2CACE;QACF,yCAAyC;QACzC,2CACE;QACF,2CACE;QACF,qCAAqC;QACrC,uCAAuC;QACvC,yCAAyC;QACzC,qCAAqC;QAErC,SAAS;QACT,mCAAmC;QACnC,wCAAwC;IAC1C;AACF,EAAC"}
@@ -0,0 +1,2 @@
1
+ import type { PluginTranslations } from '../types.js';
2
+ export declare const frTranslations: PluginTranslations;
@@ -0,0 +1,76 @@
1
+ export const frTranslations = {
2
+ 'plugin-roles-privileges': {
3
+ // Roles collection
4
+ 'roles-collection-label-singular': 'Rôle',
5
+ 'roles-collection-label-plural': 'Rôles',
6
+ 'roles-field-title-label': 'Titre du rôle',
7
+ 'roles-field-slug-label': 'Slug',
8
+ 'roles-field-slug-description': 'Identifiant unique pour ce rôle',
9
+ 'roles-field-privileges-label': 'Privilèges',
10
+ 'roles-field-privileges-description': 'Sélectionnez les privilèges que ce rôle devrait avoir',
11
+ 'roles-field-description-label': 'Description',
12
+ 'roles-field-description-description': 'Description optionnelle de ce rôle',
13
+ // Privileges UI
14
+ 'privileges-column-collections-globals': 'Collections & Globals',
15
+ 'privileges-column-privileges': 'Privilèges',
16
+ 'privileges-column-description': 'Description',
17
+ 'privileges-select-placeholder': 'Sélectionnez une collection ou un global pour voir les privilèges',
18
+ 'privileges-select-privilege-placeholder': 'Sélectionnez un privilège pour voir sa description',
19
+ 'privileges-selected-count': 'Privilèges sélectionnés',
20
+ // Privilege operations
21
+ 'privilege-operation-create': 'Créer',
22
+ 'privilege-operation-read': 'Lire',
23
+ 'privilege-operation-update': 'Mettre à jour',
24
+ 'privilege-operation-delete': 'Supprimer',
25
+ // Collection privilege operation prefixes
26
+ 'privilege-prefix-admin': 'Accès administrateur à',
27
+ 'privilege-prefix-create': 'Créer',
28
+ 'privilege-prefix-read': 'Lire',
29
+ 'privilege-prefix-readVersions': 'Lire les versions:',
30
+ 'privilege-prefix-update': 'Modifier',
31
+ 'privilege-prefix-delete': 'Supprimer',
32
+ 'privilege-prefix-unlock': 'Déverrouiller',
33
+ // Collection privilege description templates
34
+ 'privilege-template-admin': "Accéder au panneau d'administration et à l'interface utilisateur des {label}",
35
+ 'privilege-template-admin-plural': 'true',
36
+ 'privilege-template-create': 'Possibilité de créer de nouveaux {label}',
37
+ 'privilege-template-create-plural': 'true',
38
+ 'privilege-template-read': 'Voir le contenu et les informations de {label}',
39
+ 'privilege-template-read-plural': 'false',
40
+ 'privilege-template-readVersions': 'Accéder et voir les versions précédentes des {label}',
41
+ 'privilege-template-readVersions-plural': 'true',
42
+ 'privilege-template-update': 'Modifier les données existantes de {label}',
43
+ 'privilege-template-update-plural': 'false',
44
+ 'privilege-template-delete': 'Supprimer {label} du système',
45
+ 'privilege-template-delete-plural': 'true',
46
+ 'privilege-template-unlock': "Déverrouiller {label} en cours de modification par d'autres utilisateurs",
47
+ 'privilege-template-unlock-plural': 'true',
48
+ // Global privilege operation prefixes
49
+ 'privilege-prefix-global-read': 'Lire',
50
+ 'privilege-prefix-global-readDrafts': 'Lire les brouillons:',
51
+ 'privilege-prefix-global-readVersions': 'Lire les versions:',
52
+ 'privilege-prefix-global-update': 'Modifier',
53
+ // Global privilege description templates
54
+ 'privilege-template-global-read': 'Voir le contenu et les paramètres de {label}',
55
+ 'privilege-template-global-readDrafts': 'Accéder et voir les brouillons de {label}',
56
+ 'privilege-template-global-readVersions': 'Accéder et voir les versions précédentes de {label}',
57
+ 'privilege-template-global-update': 'Modifier les paramètres et données de {label}',
58
+ // Collection/Global description templates
59
+ 'privilege-collection-description': 'Gérer {label} dans le système',
60
+ 'privilege-global-description': 'Gérer les paramètres globaux de {label}',
61
+ // Privilege descriptions
62
+ 'privilege-description-collection-create': 'Permet les opérations de création sur la collection {{collection}}',
63
+ 'privilege-description-collection-read': 'Permet les opérations de lecture sur la collection {{collection}}',
64
+ 'privilege-description-collection-update': 'Permet les opérations de mise à jour sur la collection {{collection}}',
65
+ 'privilege-description-collection-delete': 'Permet les opérations de suppression sur la collection {{collection}}',
66
+ 'privilege-description-global-read': "Permet l'accès en lecture au global {{global}}",
67
+ 'privilege-description-global-update': "Permet l'accès en mise à jour au global {{global}}",
68
+ 'privilege-description-collection-info': "Gérer les privilèges d'accès pour cette collection",
69
+ 'privilege-description-global-info': "Gérer les privilèges d'accès pour ce global",
70
+ // Errors
71
+ 'error-cannot-delete-super-admin': 'Impossible de supprimer le rôle Super Admin',
72
+ 'error-cannot-modify-super-admin-slug': 'Impossible de modifier le slug du rôle Super Admin'
73
+ }
74
+ };
75
+
76
+ //# sourceMappingURL=fr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/translations/languages/fr.ts"],"sourcesContent":["import type { PluginTranslations } from '../types.js'\n\nexport const frTranslations: PluginTranslations = {\n 'plugin-roles-privileges': {\n // Roles collection\n 'roles-collection-label-singular': 'Rôle',\n 'roles-collection-label-plural': 'Rôles',\n 'roles-field-title-label': 'Titre du rôle',\n 'roles-field-slug-label': 'Slug',\n 'roles-field-slug-description': 'Identifiant unique pour ce rôle',\n 'roles-field-privileges-label': 'Privilèges',\n 'roles-field-privileges-description': 'Sélectionnez les privilèges que ce rôle devrait avoir',\n 'roles-field-description-label': 'Description',\n 'roles-field-description-description': 'Description optionnelle de ce rôle',\n\n // Privileges UI\n 'privileges-column-collections-globals': 'Collections & Globals',\n 'privileges-column-privileges': 'Privilèges',\n 'privileges-column-description': 'Description',\n 'privileges-select-placeholder':\n 'Sélectionnez une collection ou un global pour voir les privilèges',\n 'privileges-select-privilege-placeholder': 'Sélectionnez un privilège pour voir sa description',\n 'privileges-selected-count': 'Privilèges sélectionnés',\n\n // Privilege operations\n 'privilege-operation-create': 'Créer',\n 'privilege-operation-read': 'Lire',\n 'privilege-operation-update': 'Mettre à jour',\n 'privilege-operation-delete': 'Supprimer',\n\n // Collection privilege operation prefixes\n 'privilege-prefix-admin': 'Accès administrateur à',\n 'privilege-prefix-create': 'Créer',\n 'privilege-prefix-read': 'Lire',\n 'privilege-prefix-readVersions': 'Lire les versions:',\n 'privilege-prefix-update': 'Modifier',\n 'privilege-prefix-delete': 'Supprimer',\n 'privilege-prefix-unlock': 'Déverrouiller',\n\n // Collection privilege description templates\n 'privilege-template-admin':\n \"Accéder au panneau d'administration et à l'interface utilisateur des {label}\",\n 'privilege-template-admin-plural': 'true',\n 'privilege-template-create': 'Possibilité de créer de nouveaux {label}',\n 'privilege-template-create-plural': 'true',\n 'privilege-template-read': 'Voir le contenu et les informations de {label}',\n 'privilege-template-read-plural': 'false',\n 'privilege-template-readVersions': 'Accéder et voir les versions précédentes des {label}',\n 'privilege-template-readVersions-plural': 'true',\n 'privilege-template-update': 'Modifier les données existantes de {label}',\n 'privilege-template-update-plural': 'false',\n 'privilege-template-delete': 'Supprimer {label} du système',\n 'privilege-template-delete-plural': 'true',\n 'privilege-template-unlock':\n \"Déverrouiller {label} en cours de modification par d'autres utilisateurs\",\n 'privilege-template-unlock-plural': 'true',\n\n // Global privilege operation prefixes\n 'privilege-prefix-global-read': 'Lire',\n 'privilege-prefix-global-readDrafts': 'Lire les brouillons:',\n 'privilege-prefix-global-readVersions': 'Lire les versions:',\n 'privilege-prefix-global-update': 'Modifier',\n\n // Global privilege description templates\n 'privilege-template-global-read': 'Voir le contenu et les paramètres de {label}',\n 'privilege-template-global-readDrafts': 'Accéder et voir les brouillons de {label}',\n 'privilege-template-global-readVersions': 'Accéder et voir les versions précédentes de {label}',\n 'privilege-template-global-update': 'Modifier les paramètres et données de {label}',\n\n // Collection/Global description templates\n 'privilege-collection-description': 'Gérer {label} dans le système',\n 'privilege-global-description': 'Gérer les paramètres globaux de {label}',\n\n // Privilege descriptions\n 'privilege-description-collection-create':\n 'Permet les opérations de création sur la collection {{collection}}',\n 'privilege-description-collection-read':\n 'Permet les opérations de lecture sur la collection {{collection}}',\n 'privilege-description-collection-update':\n 'Permet les opérations de mise à jour sur la collection {{collection}}',\n 'privilege-description-collection-delete':\n 'Permet les opérations de suppression sur la collection {{collection}}',\n 'privilege-description-global-read': \"Permet l'accès en lecture au global {{global}}\",\n 'privilege-description-global-update': \"Permet l'accès en mise à jour au global {{global}}\",\n 'privilege-description-collection-info': \"Gérer les privilèges d'accès pour cette collection\",\n 'privilege-description-global-info': \"Gérer les privilèges d'accès pour ce global\",\n\n // Errors\n 'error-cannot-delete-super-admin': 'Impossible de supprimer le rôle Super Admin',\n 'error-cannot-modify-super-admin-slug': 'Impossible de modifier le slug du rôle Super Admin',\n },\n}\n"],"names":["frTranslations"],"mappings":"AAEA,OAAO,MAAMA,iBAAqC;IAChD,2BAA2B;QACzB,mBAAmB;QACnB,mCAAmC;QACnC,iCAAiC;QACjC,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,gCAAgC;QAChC,sCAAsC;QACtC,iCAAiC;QACjC,uCAAuC;QAEvC,gBAAgB;QAChB,yCAAyC;QACzC,gCAAgC;QAChC,iCAAiC;QACjC,iCACE;QACF,2CAA2C;QAC3C,6BAA6B;QAE7B,uBAAuB;QACvB,8BAA8B;QAC9B,4BAA4B;QAC5B,8BAA8B;QAC9B,8BAA8B;QAE9B,0CAA0C;QAC1C,0BAA0B;QAC1B,2BAA2B;QAC3B,yBAAyB;QACzB,iCAAiC;QACjC,2BAA2B;QAC3B,2BAA2B;QAC3B,2BAA2B;QAE3B,6CAA6C;QAC7C,4BACE;QACF,mCAAmC;QACnC,6BAA6B;QAC7B,oCAAoC;QACpC,2BAA2B;QAC3B,kCAAkC;QAClC,mCAAmC;QACnC,0CAA0C;QAC1C,6BAA6B;QAC7B,oCAAoC;QACpC,6BAA6B;QAC7B,oCAAoC;QACpC,6BACE;QACF,oCAAoC;QAEpC,sCAAsC;QACtC,gCAAgC;QAChC,sCAAsC;QACtC,wCAAwC;QACxC,kCAAkC;QAElC,yCAAyC;QACzC,kCAAkC;QAClC,wCAAwC;QACxC,0CAA0C;QAC1C,oCAAoC;QAEpC,0CAA0C;QAC1C,oCAAoC;QACpC,gCAAgC;QAEhC,yBAAyB;QACzB,2CACE;QACF,yCACE;QACF,2CACE;QACF,2CACE;QACF,qCAAqC;QACrC,uCAAuC;QACvC,yCAAyC;QACzC,qCAAqC;QAErC,SAAS;QACT,mCAAmC;QACnC,wCAAwC;IAC1C;AACF,EAAC"}
@@ -0,0 +1,67 @@
1
+ export type PluginTranslations = {
2
+ 'plugin-roles-privileges': {
3
+ 'roles-collection-label-singular': string;
4
+ 'roles-collection-label-plural': string;
5
+ 'roles-field-title-label': string;
6
+ 'roles-field-slug-label': string;
7
+ 'roles-field-slug-description': string;
8
+ 'roles-field-privileges-label': string;
9
+ 'roles-field-privileges-description': string;
10
+ 'roles-field-description-label': string;
11
+ 'roles-field-description-description': string;
12
+ 'privileges-column-collections-globals': string;
13
+ 'privileges-column-privileges': string;
14
+ 'privileges-column-description': string;
15
+ 'privileges-select-placeholder': string;
16
+ 'privileges-select-privilege-placeholder': string;
17
+ 'privileges-selected-count': string;
18
+ 'privilege-operation-create': string;
19
+ 'privilege-operation-read': string;
20
+ 'privilege-operation-update': string;
21
+ 'privilege-operation-delete': string;
22
+ 'privilege-prefix-admin': string;
23
+ 'privilege-prefix-create': string;
24
+ 'privilege-prefix-read': string;
25
+ 'privilege-prefix-readVersions': string;
26
+ 'privilege-prefix-update': string;
27
+ 'privilege-prefix-delete': string;
28
+ 'privilege-prefix-unlock': string;
29
+ 'privilege-template-admin': string;
30
+ 'privilege-template-admin-plural': string;
31
+ 'privilege-template-create': string;
32
+ 'privilege-template-create-plural': string;
33
+ 'privilege-template-read': string;
34
+ 'privilege-template-read-plural': string;
35
+ 'privilege-template-readVersions': string;
36
+ 'privilege-template-readVersions-plural': string;
37
+ 'privilege-template-update': string;
38
+ 'privilege-template-update-plural': string;
39
+ 'privilege-template-delete': string;
40
+ 'privilege-template-delete-plural': string;
41
+ 'privilege-template-unlock': string;
42
+ 'privilege-template-unlock-plural': string;
43
+ 'privilege-prefix-global-read': string;
44
+ 'privilege-prefix-global-readDrafts': string;
45
+ 'privilege-prefix-global-readVersions': string;
46
+ 'privilege-prefix-global-update': string;
47
+ 'privilege-template-global-read': string;
48
+ 'privilege-template-global-readDrafts': string;
49
+ 'privilege-template-global-readVersions': string;
50
+ 'privilege-template-global-update': string;
51
+ 'privilege-collection-description': string;
52
+ 'privilege-global-description': string;
53
+ 'privilege-description-collection-create': string;
54
+ 'privilege-description-collection-read': string;
55
+ 'privilege-description-collection-update': string;
56
+ 'privilege-description-collection-delete': string;
57
+ 'privilege-description-global-read': string;
58
+ 'privilege-description-global-update': string;
59
+ 'privilege-description-collection-info': string;
60
+ 'privilege-description-global-info': string;
61
+ 'error-cannot-delete-super-admin': string;
62
+ 'error-cannot-modify-super-admin-slug': string;
63
+ };
64
+ };
65
+ export type PluginDefaultTranslationsObject = {
66
+ 'plugin-roles-privileges': PluginTranslations['plugin-roles-privileges'];
67
+ };
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/translations/types.ts"],"sourcesContent":["export type PluginTranslations = {\n 'plugin-roles-privileges': {\n // Roles collection\n 'roles-collection-label-singular': string\n 'roles-collection-label-plural': string\n 'roles-field-title-label': string\n 'roles-field-slug-label': string\n 'roles-field-slug-description': string\n 'roles-field-privileges-label': string\n 'roles-field-privileges-description': string\n 'roles-field-description-label': string\n 'roles-field-description-description': string\n\n // Privileges UI\n 'privileges-column-collections-globals': string\n 'privileges-column-privileges': string\n 'privileges-column-description': string\n 'privileges-select-placeholder': string\n 'privileges-select-privilege-placeholder': string\n 'privileges-selected-count': string\n\n // Privilege operations\n 'privilege-operation-create': string\n 'privilege-operation-read': string\n 'privilege-operation-update': string\n 'privilege-operation-delete': string\n\n // Collection privilege operation prefixes\n 'privilege-prefix-admin': string\n 'privilege-prefix-create': string\n 'privilege-prefix-read': string\n 'privilege-prefix-readVersions': string\n 'privilege-prefix-update': string\n 'privilege-prefix-delete': string\n 'privilege-prefix-unlock': string\n\n // Collection privilege description templates\n 'privilege-template-admin': string\n 'privilege-template-admin-plural': string\n 'privilege-template-create': string\n 'privilege-template-create-plural': string\n 'privilege-template-read': string\n 'privilege-template-read-plural': string\n 'privilege-template-readVersions': string\n 'privilege-template-readVersions-plural': string\n 'privilege-template-update': string\n 'privilege-template-update-plural': string\n 'privilege-template-delete': string\n 'privilege-template-delete-plural': string\n 'privilege-template-unlock': string\n 'privilege-template-unlock-plural': string\n\n // Global privilege operation prefixes\n 'privilege-prefix-global-read': string\n 'privilege-prefix-global-readDrafts': string\n 'privilege-prefix-global-readVersions': string\n 'privilege-prefix-global-update': string\n\n // Global privilege description templates\n 'privilege-template-global-read': string\n 'privilege-template-global-readDrafts': string\n 'privilege-template-global-readVersions': string\n 'privilege-template-global-update': string\n\n // Collection/Global description templates\n 'privilege-collection-description': string\n 'privilege-global-description': string\n\n // Privilege descriptions (legacy)\n 'privilege-description-collection-create': string\n 'privilege-description-collection-read': string\n 'privilege-description-collection-update': string\n 'privilege-description-collection-delete': string\n 'privilege-description-global-read': string\n 'privilege-description-global-update': string\n 'privilege-description-collection-info': string\n 'privilege-description-global-info': string\n\n // Errors\n 'error-cannot-delete-super-admin': string\n 'error-cannot-modify-super-admin-slug': string\n }\n}\n\nexport type PluginDefaultTranslationsObject = {\n 'plugin-roles-privileges': PluginTranslations['plugin-roles-privileges']\n}\n"],"names":[],"mappings":"AAoFA,WAEC"}