@simplysf/simply-permissions 1.2.1 → 1.2.3
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/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# @simplysf/simply-permissions
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/@simplysf/simply-permissions) [](https://npmjs.com/@simplysf/simply-permissions) [](https://raw.githubusercontent.com/SimplySF/simply/main/LICENSE.txt)
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
sf plugins install @simplysf/simply-permissions
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Issues
|
|
12
|
+
|
|
13
|
+
Please report any issues at https://github.com/SimplySF/simply/issues
|
|
14
|
+
|
|
15
|
+
## Contributing
|
|
16
|
+
|
|
17
|
+
This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/simply) monorepo. See the repo's [CONTRIBUTING.md](https://github.com/SimplySF/simply/blob/main/CONTRIBUTING.md) for the repo structure, how to set up and build the project, our commit conventions, and how to submit a pull request. Please also read our [Code of Conduct](https://github.com/SimplySF/simply/blob/main/CODE_OF_CONDUCT.md).
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
<!-- commands -->
|
|
22
|
+
|
|
23
|
+
- [`sf simply permissions analyze`](#sf-simply-permissions-analyze)
|
|
24
|
+
- [`sf simply permissions build`](#sf-simply-permissions-build)
|
|
25
|
+
|
|
26
|
+
## `sf simply permissions analyze`
|
|
27
|
+
|
|
28
|
+
Analyze permission sets and permission set groups in an org.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
USAGE
|
|
32
|
+
$ sf simply permissions analyze -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-f <value>...] [--output
|
|
33
|
+
<value>]
|
|
34
|
+
|
|
35
|
+
FLAGS
|
|
36
|
+
-f, --filter=<value>... Permission set or group names to include
|
|
37
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
38
|
+
configuration variable is already set.
|
|
39
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
40
|
+
--output=<value> [default: permissions_report.html] Output HTML file path
|
|
41
|
+
|
|
42
|
+
GLOBAL FLAGS
|
|
43
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
44
|
+
--json Format output as json.
|
|
45
|
+
|
|
46
|
+
DESCRIPTION
|
|
47
|
+
Analyze permission sets and permission set groups in an org.
|
|
48
|
+
|
|
49
|
+
Generates an HTML report of every permission set and permission set group in the target org, grouped by installed
|
|
50
|
+
package, including their object and field permissions.
|
|
51
|
+
|
|
52
|
+
EXAMPLES
|
|
53
|
+
$ sf simply permissions analyze --target-org myOrg
|
|
54
|
+
|
|
55
|
+
$ sf simply permissions analyze --target-org myOrg --output reports/permissions.html --filter My_Permission_Set --filter Another_Set
|
|
56
|
+
|
|
57
|
+
FLAG DESCRIPTIONS
|
|
58
|
+
-f, --filter=<value>... Permission set or group names to include
|
|
59
|
+
|
|
60
|
+
One or more PermissionSet (Name) or PermissionSetGroup (DeveloperName) API names to restrict the report to. If
|
|
61
|
+
omitted, all permission sets and groups are included.
|
|
62
|
+
|
|
63
|
+
--output=<value> Output HTML file path
|
|
64
|
+
|
|
65
|
+
The path to write the generated HTML report to.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
_See code: [lib/commands/simply/permissions/analyze.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-permissions@1.2.1/packages/simply-permissions/lib/commands/simply/permissions/analyze.js)_
|
|
69
|
+
|
|
70
|
+
## `sf simply permissions build`
|
|
71
|
+
|
|
72
|
+
Generate a permission set from Salesforce source metadata.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
USAGE
|
|
76
|
+
$ sf simply permissions build --type read-only|view-all|modify-all -n <value> -d <value> --output <value> [--json]
|
|
77
|
+
[--flags-dir <value>] [-c <value>] [--include-record-types] [--label <value>] [--description <value>]
|
|
78
|
+
|
|
79
|
+
FLAGS
|
|
80
|
+
-c, --config=<value> Path to a permission set configuration file
|
|
81
|
+
-d, --directory=<value> (required) Path to the Salesforce project directory
|
|
82
|
+
-n, --name=<value> (required) API name for the permission set
|
|
83
|
+
--description=<value> Description for the permission set
|
|
84
|
+
--include-record-types Include record type visibilities
|
|
85
|
+
--label=<value> Label for the permission set
|
|
86
|
+
--output=<value> (required) Output directory
|
|
87
|
+
--type=<option> (required) Baseline permission type
|
|
88
|
+
<options: read-only|view-all|modify-all>
|
|
89
|
+
|
|
90
|
+
GLOBAL FLAGS
|
|
91
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
92
|
+
--json Format output as json.
|
|
93
|
+
|
|
94
|
+
DESCRIPTION
|
|
95
|
+
Generate a permission set from Salesforce source metadata.
|
|
96
|
+
|
|
97
|
+
Scans a Salesforce project directory for custom objects, fields, tabs, and (optionally) record types, then generates a
|
|
98
|
+
permission set XML file with a baseline of permissions determined by --type. An optional JSON --config file can
|
|
99
|
+
override individual object, field, tab, record type, and user permission settings.
|
|
100
|
+
|
|
101
|
+
EXAMPLES
|
|
102
|
+
$ sf simply permissions build --type read-only --name My_Read_Only_Access --directory force-app --output force-app/main/default/permissionsets
|
|
103
|
+
|
|
104
|
+
$ sf simply permissions build --type modify-all --name My_Admin_Access --directory force-app --config config/permission-overrides.json --output force-app/main/default/permissionsets --include-record-types
|
|
105
|
+
|
|
106
|
+
FLAG DESCRIPTIONS
|
|
107
|
+
-c, --config=<value> Path to a permission set configuration file
|
|
108
|
+
|
|
109
|
+
The path to a JSON file that overrides individual object, field, tab, record type, and user permission settings on
|
|
110
|
+
top of the --type baseline.
|
|
111
|
+
|
|
112
|
+
-d, --directory=<value> Path to the Salesforce project directory
|
|
113
|
+
|
|
114
|
+
The path to the Salesforce source directory to scan for custom objects, fields, tabs, and record types.
|
|
115
|
+
|
|
116
|
+
-n, --name=<value> API name for the permission set
|
|
117
|
+
|
|
118
|
+
The API name for the generated permission set; also used to derive the output filename.
|
|
119
|
+
|
|
120
|
+
--include-record-types Include record type visibilities
|
|
121
|
+
|
|
122
|
+
Automatically include record type visibilities discovered from the source metadata, marked as visible by default.
|
|
123
|
+
|
|
124
|
+
--output=<value> Output directory
|
|
125
|
+
|
|
126
|
+
The directory to write the generated permission set XML file to.
|
|
127
|
+
|
|
128
|
+
--type=read-only|view-all|modify-all Baseline permission type
|
|
129
|
+
|
|
130
|
+
The baseline permission level to generate: 'read-only' grants read access to all discovered objects and fields,
|
|
131
|
+
'view-all' additionally grants view-all-records, and 'modify-all' grants full CRUD and modify-all-records access.
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
_See code: [lib/commands/simply/permissions/build.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-permissions@1.2.1/packages/simply-permissions/lib/commands/simply/permissions/build.js)_
|
|
135
|
+
<!-- commandsstop -->
|
|
@@ -14,12 +14,18 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import fs from 'node:fs/promises';
|
|
17
|
+
import { parse } from 'csv-parse';
|
|
17
18
|
import { Messages } from '@salesforce/core';
|
|
18
19
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
20
|
+
import { streamBulkQuery } from '@simplysf/simply-core';
|
|
19
21
|
import { buildPermissionsReportHtml, } from '../../../common/permissionsReportTemplate.js';
|
|
20
22
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
21
23
|
const messages = Messages.loadMessages('@simplysf/simply-permissions', 'simply.permissions.analyze');
|
|
22
24
|
const ID_CHUNK_SIZE = 100;
|
|
25
|
+
// Bulk API v2 results are CSV, so every field arrives as a string. ObjectPermissions/
|
|
26
|
+
// FieldPermissions carry boolean columns, so cast the CSV "true"/"false" strings back to real
|
|
27
|
+
// booleans while parsing.
|
|
28
|
+
const castBooleanStrings = (value) => (value === 'true' ? true : value === 'false' ? false : value);
|
|
23
29
|
export default class PermissionsAnalyze extends SfCommand {
|
|
24
30
|
static summary = messages.getMessage('summary');
|
|
25
31
|
static description = messages.getMessage('description');
|
|
@@ -91,45 +97,45 @@ export default class PermissionsAnalyze extends SfCommand {
|
|
|
91
97
|
const objectPermissions = new Map();
|
|
92
98
|
const fieldPermissions = new Map();
|
|
93
99
|
const psIds = permissionSetsInScope.map((r) => r.Id);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
if (psIds.length > 0) {
|
|
101
|
+
// Bulk API v2 queries aren't subject to the same WHERE-clause length constraints as REST
|
|
102
|
+
// SOQL, and these can return far more rows than PermissionSet/PermissionSetGroup (every
|
|
103
|
+
// object/field permission for every in-scope permission set), so there's no need to chunk
|
|
104
|
+
// the ID list here the way the Tooling API query below still has to.
|
|
105
|
+
const idsClause = psIds.map((id) => `'${id}'`).join(',');
|
|
106
|
+
const [objectPermissionsQuery, fieldPermissionsQuery] = await Promise.all([
|
|
107
|
+
streamBulkQuery(connection, `SELECT ParentId, SobjectType, PermissionsRead, PermissionsCreate, PermissionsEdit, PermissionsDelete, PermissionsViewAllRecords, PermissionsModifyAllRecords FROM ObjectPermissions WHERE ParentId IN (${idsClause})`),
|
|
108
|
+
streamBulkQuery(connection, `SELECT ParentId, SobjectType, Field, PermissionsRead, PermissionsEdit FROM FieldPermissions WHERE ParentId IN (${idsClause})`),
|
|
101
109
|
]);
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
objRecords.forEach((r) => {
|
|
110
|
+
for await (const record of objectPermissionsQuery.stream.pipe(parse({ columns: true, cast: castBooleanStrings }))) {
|
|
111
|
+
const r = record;
|
|
105
112
|
if (!objectPermissions.has(r.ParentId)) {
|
|
106
113
|
objectPermissions.set(r.ParentId, []);
|
|
107
114
|
}
|
|
108
115
|
objectPermissions.get(r.ParentId)?.push(r);
|
|
109
|
-
}
|
|
110
|
-
|
|
116
|
+
}
|
|
117
|
+
for await (const record of fieldPermissionsQuery.stream.pipe(parse({ columns: true, cast: castBooleanStrings }))) {
|
|
118
|
+
const r = record;
|
|
111
119
|
if (!fieldPermissions.has(r.ParentId)) {
|
|
112
120
|
fieldPermissions.set(r.ParentId, []);
|
|
113
121
|
}
|
|
114
122
|
fieldPermissions.get(r.ParentId)?.push(r);
|
|
115
|
-
}
|
|
123
|
+
}
|
|
116
124
|
}
|
|
117
125
|
this.spinner.stop();
|
|
118
126
|
this.spinner.start(messages.getMessage('info.mappingGroups'));
|
|
119
127
|
const groupComponents = new Map();
|
|
120
128
|
const psgIds = permissionSetGroups.map((r) => r.Id);
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const compRecords = compRes.records;
|
|
127
|
-
compRecords.forEach((r) => {
|
|
129
|
+
if (psgIds.length > 0) {
|
|
130
|
+
const idsClause = psgIds.map((id) => `'${id}'`).join(',');
|
|
131
|
+
const groupComponentsQuery = await streamBulkQuery(connection, `SELECT PermissionSetGroupId, PermissionSetId FROM PermissionSetGroupComponent WHERE PermissionSetGroupId IN (${idsClause})`);
|
|
132
|
+
for await (const record of groupComponentsQuery.stream.pipe(parse({ columns: true }))) {
|
|
133
|
+
const r = record;
|
|
128
134
|
if (!groupComponents.has(r.PermissionSetGroupId)) {
|
|
129
135
|
groupComponents.set(r.PermissionSetGroupId, []);
|
|
130
136
|
}
|
|
131
137
|
groupComponents.get(r.PermissionSetGroupId)?.push(r.PermissionSetId);
|
|
132
|
-
}
|
|
138
|
+
}
|
|
133
139
|
}
|
|
134
140
|
this.spinner.stop();
|
|
135
141
|
this.spinner.start(messages.getMessage('info.generatingReport'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../../../src/commands/simply/permissions/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,QAAQ,EA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IAAI,IAAI,EAAE,CAAC,cAAc,EAAE;YACvC,WAAW;SACZ,CAAC,CAAC;QAEH,MAAM,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAEpB,MAAM,kBAAkB,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC1G,MAAM,uBAAuB,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAEpH,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAEvE,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC;IACnF,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.3",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply/issues",
|
|
@@ -61,11 +61,15 @@
|
|
|
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.0",
|
|
65
|
+
"csv-parse": "^7.0.2",
|
|
64
66
|
"zod": "^4.1.12"
|
|
65
67
|
},
|
|
66
68
|
"devDependencies": {
|
|
67
69
|
"@oclif/plugin-command-snapshot": "^5.3.19",
|
|
68
|
-
"@salesforce/plugin-command-reference": "^3.1.99"
|
|
70
|
+
"@salesforce/plugin-command-reference": "^3.1.99",
|
|
71
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
72
|
+
"vitest": "^4.1.10"
|
|
69
73
|
},
|
|
70
74
|
"publishConfig": {
|
|
71
75
|
"access": "public"
|
|
@@ -79,9 +83,10 @@
|
|
|
79
83
|
"lint": "wireit",
|
|
80
84
|
"readme": "oclif readme --no-aliases",
|
|
81
85
|
"test": "wireit",
|
|
86
|
+
"test:coverage": "vitest run --coverage",
|
|
82
87
|
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --jobs 5",
|
|
83
88
|
"test:only": "wireit",
|
|
84
|
-
"test:watch": "
|
|
89
|
+
"test:watch": "vitest watch"
|
|
85
90
|
},
|
|
86
91
|
"wireit": {
|
|
87
92
|
"build": {
|
|
@@ -176,7 +181,7 @@
|
|
|
176
181
|
"output": []
|
|
177
182
|
},
|
|
178
183
|
"test:only": {
|
|
179
|
-
"command": "
|
|
184
|
+
"command": "vitest run",
|
|
180
185
|
"env": {
|
|
181
186
|
"FORCE_COLOR": "2"
|
|
182
187
|
},
|
|
@@ -184,9 +189,8 @@
|
|
|
184
189
|
"test/**/*.ts",
|
|
185
190
|
"src/**/*.ts",
|
|
186
191
|
"**/tsconfig.json",
|
|
187
|
-
".
|
|
188
|
-
"!*.nut.ts"
|
|
189
|
-
".nycrc"
|
|
192
|
+
"vitest.config.ts",
|
|
193
|
+
"!*.nut.ts"
|
|
190
194
|
],
|
|
191
195
|
"output": []
|
|
192
196
|
},
|
|
@@ -200,5 +204,5 @@
|
|
|
200
204
|
"output": []
|
|
201
205
|
}
|
|
202
206
|
},
|
|
203
|
-
"gitHead": "
|
|
207
|
+
"gitHead": "625d1c241740ca5cefcbc30597e04d58c23005ef"
|
|
204
208
|
}
|