@simplysf/simply-permissions 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/permissionSetXmlTemplate.d.ts +4 -0
- package/lib/common/permissionSetXmlTemplate.js +89 -63
- package/lib/common/permissionSetXmlTemplate.js.map +1 -1
- package/lib/common/permissionsReportTemplate.js +82 -87
- package/lib/common/permissionsReportTemplate.js.map +1 -1
- package/package.json +5 -3
|
@@ -43,6 +43,10 @@ export type PermissionSetTemplateData = {
|
|
|
43
43
|
/**
|
|
44
44
|
* Render a complete PermissionSet metadata XML document from template data.
|
|
45
45
|
*
|
|
46
|
+
* Element text content is set via `.txt()`, which xmlbuilder2 escapes for us — there's no
|
|
47
|
+
* hand-rolled escaping (and no risk of it drifting out of sync with what's actually unsafe in
|
|
48
|
+
* XML text content).
|
|
49
|
+
*
|
|
46
50
|
* @param data - The permission set's label, description, and permission entries.
|
|
47
51
|
* @returns The rendered `<PermissionSet>` XML document, ready to write to a `.permissionset-meta.xml` file.
|
|
48
52
|
*/
|
|
@@ -13,75 +13,101 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
* @param value - The raw string to escape.
|
|
18
|
-
* @returns `value` with XML special characters (`& < > " '`) replaced by their entity references.
|
|
19
|
-
*/
|
|
20
|
-
function escapeXml(value) {
|
|
21
|
-
return value
|
|
22
|
-
.replace(/&/g, '&')
|
|
23
|
-
.replace(/</g, '<')
|
|
24
|
-
.replace(/>/g, '>')
|
|
25
|
-
.replace(/"/g, '"')
|
|
26
|
-
.replace(/'/g, ''');
|
|
27
|
-
}
|
|
16
|
+
import { create } from 'xmlbuilder2';
|
|
28
17
|
/**
|
|
29
18
|
* Render a complete PermissionSet metadata XML document from template data.
|
|
30
19
|
*
|
|
20
|
+
* Element text content is set via `.txt()`, which xmlbuilder2 escapes for us — there's no
|
|
21
|
+
* hand-rolled escaping (and no risk of it drifting out of sync with what's actually unsafe in
|
|
22
|
+
* XML text content).
|
|
23
|
+
*
|
|
31
24
|
* @param data - The permission set's label, description, and permission entries.
|
|
32
25
|
* @returns The rendered `<PermissionSet>` XML document, ready to write to a `.permissionset-meta.xml` file.
|
|
33
26
|
*/
|
|
34
27
|
export function buildPermissionSetXml(data) {
|
|
35
|
-
const
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
28
|
+
const root = create({ version: '1.0', encoding: 'UTF-8' }).ele('PermissionSet', {
|
|
29
|
+
xmlns: 'http://soap.sforce.com/2006/04/metadata',
|
|
30
|
+
});
|
|
31
|
+
root.ele('label').txt(data.label).up();
|
|
32
|
+
if (data.description) {
|
|
33
|
+
root.ele('description').txt(data.description).up();
|
|
34
|
+
}
|
|
35
|
+
for (const permission of data.objectPermissions) {
|
|
36
|
+
root
|
|
37
|
+
.ele('objectPermissions')
|
|
38
|
+
.ele('allowCreate')
|
|
39
|
+
.txt(String(permission.allowCreate))
|
|
40
|
+
.up()
|
|
41
|
+
.ele('allowDelete')
|
|
42
|
+
.txt(String(permission.allowDelete))
|
|
43
|
+
.up()
|
|
44
|
+
.ele('allowEdit')
|
|
45
|
+
.txt(String(permission.allowEdit))
|
|
46
|
+
.up()
|
|
47
|
+
.ele('allowRead')
|
|
48
|
+
.txt(String(permission.allowRead))
|
|
49
|
+
.up()
|
|
50
|
+
.ele('object')
|
|
51
|
+
.txt(permission.object)
|
|
52
|
+
.up()
|
|
53
|
+
.ele('modifyAllRecords')
|
|
54
|
+
.txt(String(permission.modifyAllRecords))
|
|
55
|
+
.up()
|
|
56
|
+
.ele('viewAllRecords')
|
|
57
|
+
.txt(String(permission.viewAllRecords))
|
|
58
|
+
.up()
|
|
59
|
+
.ele('viewAllFields')
|
|
60
|
+
.txt(String(permission.viewAllFields))
|
|
61
|
+
.up()
|
|
62
|
+
.up();
|
|
63
|
+
}
|
|
64
|
+
for (const permission of data.fieldPermissions) {
|
|
65
|
+
root
|
|
66
|
+
.ele('fieldPermissions')
|
|
67
|
+
.ele('field')
|
|
68
|
+
.txt(permission.field)
|
|
69
|
+
.up()
|
|
70
|
+
.ele('readable')
|
|
71
|
+
.txt(String(permission.readable))
|
|
72
|
+
.up()
|
|
73
|
+
.ele('editable')
|
|
74
|
+
.txt(String(permission.editable))
|
|
75
|
+
.up()
|
|
76
|
+
.up();
|
|
77
|
+
}
|
|
78
|
+
for (const setting of data.tabSettings) {
|
|
79
|
+
root
|
|
80
|
+
.ele('tabSettings')
|
|
81
|
+
.ele('tab')
|
|
82
|
+
.txt(setting.tab)
|
|
83
|
+
.up()
|
|
84
|
+
.ele('visibility')
|
|
85
|
+
.txt(setting.visible ? 'Visible' : 'Hidden')
|
|
86
|
+
.up()
|
|
87
|
+
.up();
|
|
88
|
+
}
|
|
89
|
+
for (const visibility of data.recordTypeVisibilities) {
|
|
90
|
+
root
|
|
91
|
+
.ele('recordTypeVisibilities')
|
|
92
|
+
.ele('recordType')
|
|
93
|
+
.txt(visibility.recordType)
|
|
94
|
+
.up()
|
|
95
|
+
.ele('visible')
|
|
96
|
+
.txt(String(visibility.visible))
|
|
97
|
+
.up()
|
|
98
|
+
.up();
|
|
99
|
+
}
|
|
100
|
+
for (const permission of data.userPermissions) {
|
|
101
|
+
root
|
|
102
|
+
.ele('userPermissions')
|
|
103
|
+
.ele('name')
|
|
104
|
+
.txt(permission.name)
|
|
105
|
+
.up()
|
|
106
|
+
.ele('enabled')
|
|
107
|
+
.txt(String(permission.enabled))
|
|
108
|
+
.up()
|
|
109
|
+
.up();
|
|
110
|
+
}
|
|
111
|
+
return root.end({ prettyPrint: true });
|
|
86
112
|
}
|
|
87
113
|
//# sourceMappingURL=permissionSetXmlTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissionSetXmlTemplate.js","sourceRoot":"","sources":["../../src/common/permissionSetXmlTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"permissionSetXmlTemplate.js","sourceRoot":"","sources":["../../src/common/permissionSetXmlTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAkDrC;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAA+B;IACnE,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,EAAE;QAC9E,KAAK,EAAE,yCAAyC;KACjD,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;IAEvC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,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E,EAAE;aACJ,EAAE,EAAE,CAAC;IACV,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -13,91 +13,50 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<details>
|
|
61
|
-
<summary>${escapeHtml(permissionSetGroup.MasterLabel)} (${escapeHtml(permissionSetGroup.DeveloperName)}) [Group]</summary>
|
|
62
|
-
<div class="content">
|
|
63
|
-
${permissionSetGroup.Description ? `<p>${escapeHtml(permissionSetGroup.Description)}</p>` : ''}
|
|
64
|
-
<p><strong>Components:</strong> ${permissionSetGroup.components.map(escapeHtml).join(', ') || 'None'}</p>
|
|
65
|
-
<h4>Object Permissions</h4>
|
|
66
|
-
${renderObjectPermsTable(permissionSetGroup.objectPerms)}
|
|
67
|
-
<h4>Field Permissions</h4>
|
|
68
|
-
${renderFieldPermsTable(permissionSetGroup.fieldPerms)}
|
|
69
|
-
</div>
|
|
70
|
-
</details>`;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Render a complete, self-contained HTML report of permission sets and permission set groups,
|
|
74
|
-
* grouped by package, with each permission set/group collapsible for browsing.
|
|
75
|
-
*
|
|
76
|
-
* @param options.username - The org username the report was generated against.
|
|
77
|
-
* @param options.reportDate - The report generation date/time, displayed as-is.
|
|
78
|
-
* @param options.groupedData - The permission sets/groups to render, grouped by package.
|
|
79
|
-
* @returns The rendered HTML document.
|
|
80
|
-
*/
|
|
81
|
-
export function buildPermissionsReportHtml(options) {
|
|
82
|
-
const { username, reportDate, groupedData } = options;
|
|
83
|
-
const sortedPackages = [...groupedData.keys()].sort();
|
|
84
|
-
const sections = sortedPackages
|
|
85
|
-
.map((pkg) => {
|
|
86
|
-
const data = groupedData.get(pkg);
|
|
87
|
-
if (!data) {
|
|
88
|
-
return '';
|
|
89
|
-
}
|
|
90
|
-
return `
|
|
91
|
-
<div class="package-section" data-package="${escapeHtml(pkg)}">
|
|
92
|
-
<h2>Package: ${escapeHtml(pkg)}</h2>
|
|
93
|
-
<h3>Permission Sets (${data.permissionSets.length})</h3>
|
|
94
|
-
${data.permissionSets.map(renderPermissionSet).join('')}
|
|
95
|
-
<h3>Permission Set Groups (${data.permissionSetGroups.length})</h3>
|
|
96
|
-
${data.permissionSetGroups.map(renderPermissionSetGroup).join('')}
|
|
97
|
-
</div>`;
|
|
98
|
-
})
|
|
99
|
-
.join('');
|
|
100
|
-
return `<!DOCTYPE html>
|
|
16
|
+
import Handlebars from 'handlebars';
|
|
17
|
+
// Handlebars auto-escapes every `{{expression}}` (unlike `{{{expression}}}`, which is left raw),
|
|
18
|
+
// so none of the templates below need a hand-rolled escapeHtml() call.
|
|
19
|
+
const handlebars = Handlebars.create();
|
|
20
|
+
// `Field` is the fully-qualified `Object.Field` name; the report only displays the field half.
|
|
21
|
+
handlebars.registerHelper('fieldName', (field) => field.split('.')[1] ?? field);
|
|
22
|
+
const objectPermsTableSource = `
|
|
23
|
+
{{~#if perms}}
|
|
24
|
+
<table><thead><tr><th>Object</th><th>Read</th><th>Create</th><th>Edit</th><th>Delete</th><th>View All</th><th>Modify All</th></tr></thead><tbody>{{#each perms}}<tr><td>{{SobjectType}}</td><td>{{PermissionsRead}}</td><td>{{PermissionsCreate}}</td><td>{{PermissionsEdit}}</td><td>{{PermissionsDelete}}</td><td>{{PermissionsViewAllRecords}}</td><td>{{PermissionsModifyAllRecords}}</td></tr>{{/each}}</tbody></table>
|
|
25
|
+
{{~else~}}
|
|
26
|
+
<p>No object permissions.</p>
|
|
27
|
+
{{~/if~}}
|
|
28
|
+
`;
|
|
29
|
+
const fieldPermsTableSource = `
|
|
30
|
+
{{~#if perms}}
|
|
31
|
+
<table><thead><tr><th>Object</th><th>Field</th><th>Read</th><th>Edit</th></tr></thead><tbody>{{#each perms}}<tr><td>{{SobjectType}}</td><td>{{fieldName Field}}</td><td>{{PermissionsRead}}</td><td>{{PermissionsEdit}}</td></tr>{{/each}}</tbody></table>
|
|
32
|
+
{{~else~}}
|
|
33
|
+
<p>No field permissions.</p>
|
|
34
|
+
{{~/if~}}
|
|
35
|
+
`;
|
|
36
|
+
const permissionSetSource = `
|
|
37
|
+
<details>
|
|
38
|
+
<summary>{{Label}} ({{Name}})</summary>
|
|
39
|
+
<div class="content">
|
|
40
|
+
{{#if Description}}<p>{{Description}}</p>{{/if}}
|
|
41
|
+
<h4>Object Permissions</h4>
|
|
42
|
+
{{> objectPermsTable perms=objectPerms}}
|
|
43
|
+
<h4>Field Permissions</h4>
|
|
44
|
+
{{> fieldPermsTable perms=fieldPerms}}
|
|
45
|
+
</div>
|
|
46
|
+
</details>`;
|
|
47
|
+
const permissionSetGroupSource = `
|
|
48
|
+
<details>
|
|
49
|
+
<summary>{{MasterLabel}} ({{DeveloperName}}) [Group]</summary>
|
|
50
|
+
<div class="content">
|
|
51
|
+
{{#if Description}}<p>{{Description}}</p>{{/if}}
|
|
52
|
+
<p><strong>Components:</strong> {{componentsDisplay}}</p>
|
|
53
|
+
<h4>Object Permissions</h4>
|
|
54
|
+
{{> objectPermsTable perms=objectPerms}}
|
|
55
|
+
<h4>Field Permissions</h4>
|
|
56
|
+
{{> fieldPermsTable perms=fieldPerms}}
|
|
57
|
+
</div>
|
|
58
|
+
</details>`;
|
|
59
|
+
const reportSource = `<!DOCTYPE html>
|
|
101
60
|
<html lang="en">
|
|
102
61
|
<head>
|
|
103
62
|
<meta charset="UTF-8">
|
|
@@ -118,9 +77,45 @@ export function buildPermissionsReportHtml(options) {
|
|
|
118
77
|
</head>
|
|
119
78
|
<body>
|
|
120
79
|
<h1>Permissions Report</h1>
|
|
121
|
-
<p>Org: <strong
|
|
122
|
-
|
|
80
|
+
<p>Org: <strong>{{username}}</strong> | Generated: {{reportDate}}</p>
|
|
81
|
+
{{#each packages}}
|
|
82
|
+
<div class="package-section" data-package="{{name}}">
|
|
83
|
+
<h2>Package: {{name}}</h2>
|
|
84
|
+
<h3>Permission Sets ({{permissionSets.length}})</h3>
|
|
85
|
+
{{#each permissionSets}}{{> permissionSet}}{{/each}}
|
|
86
|
+
<h3>Permission Set Groups ({{permissionSetGroups.length}})</h3>
|
|
87
|
+
{{#each permissionSetGroups}}{{> permissionSetGroup}}{{/each}}
|
|
88
|
+
</div>
|
|
89
|
+
{{/each}}
|
|
123
90
|
</body>
|
|
124
91
|
</html>`;
|
|
92
|
+
handlebars.registerPartial('objectPermsTable', objectPermsTableSource);
|
|
93
|
+
handlebars.registerPartial('fieldPermsTable', fieldPermsTableSource);
|
|
94
|
+
handlebars.registerPartial('permissionSet', permissionSetSource);
|
|
95
|
+
handlebars.registerPartial('permissionSetGroup', permissionSetGroupSource);
|
|
96
|
+
const renderReport = handlebars.compile(reportSource);
|
|
97
|
+
/**
|
|
98
|
+
* Render a complete, self-contained HTML report of permission sets and permission set groups,
|
|
99
|
+
* grouped by package, with each permission set/group collapsible for browsing.
|
|
100
|
+
*
|
|
101
|
+
* @param options.username - The org username the report was generated against.
|
|
102
|
+
* @param options.reportDate - The report generation date/time, displayed as-is.
|
|
103
|
+
* @param options.groupedData - The permission sets/groups to render, grouped by package.
|
|
104
|
+
* @returns The rendered HTML document.
|
|
105
|
+
*/
|
|
106
|
+
export function buildPermissionsReportHtml(options) {
|
|
107
|
+
const { username, reportDate, groupedData } = options;
|
|
108
|
+
const packages = [...groupedData.keys()].sort().map((name) => {
|
|
109
|
+
const data = groupedData.get(name);
|
|
110
|
+
return {
|
|
111
|
+
name,
|
|
112
|
+
permissionSets: data?.permissionSets ?? [],
|
|
113
|
+
permissionSetGroups: (data?.permissionSetGroups ?? []).map((group) => ({
|
|
114
|
+
...group,
|
|
115
|
+
componentsDisplay: group.components.length > 0 ? group.components.join(', ') : 'None',
|
|
116
|
+
})),
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
return renderReport({ username, reportDate, packages });
|
|
125
120
|
}
|
|
126
121
|
//# sourceMappingURL=permissionsReportTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissionsReportTemplate.js","sourceRoot":"","sources":["../../src/common/permissionsReportTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"permissionsReportTemplate.js","sourceRoot":"","sources":["../../src/common/permissionsReportTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAgDpC,iGAAiG;AACjG,uEAAuE;AACvE,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;AAEvC,+FAA+F;AAC/F,UAAU,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC;AAEhG,MAAM,sBAAsB,GAAG;;;;;;CAM9B,CAAC;AAEF,MAAM,qBAAqB,GAAG;;;;;;CAM7B,CAAC;AAEF,MAAM,mBAA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;IAEH,OAAO,YAAY,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-permissions",
|
|
3
3
|
"description": "Utilities for working with permissions",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.9",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply/issues",
|
|
@@ -61,7 +61,9 @@
|
|
|
61
61
|
"@salesforce/kit": "^3.2.6",
|
|
62
62
|
"@salesforce/sf-plugins-core": "^12.2.16",
|
|
63
63
|
"@salesforce/source-deploy-retrieve": "^12.37.2",
|
|
64
|
-
"@simplysf/simply-core": "^1.1.
|
|
64
|
+
"@simplysf/simply-core": "^1.1.5",
|
|
65
|
+
"handlebars": "^4.7.9",
|
|
66
|
+
"xmlbuilder2": "^4.0.3",
|
|
65
67
|
"zod": "^4.1.12"
|
|
66
68
|
},
|
|
67
69
|
"devDependencies": {
|
|
@@ -208,5 +210,5 @@
|
|
|
208
210
|
"output": []
|
|
209
211
|
}
|
|
210
212
|
},
|
|
211
|
-
"gitHead": "
|
|
213
|
+
"gitHead": "99fde0b9705ed0bdd1b30a973a9e1dae92c724c8"
|
|
212
214
|
}
|