@simplysf/simply-permissions 1.6.0 → 1.7.0
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 +27 -12
- package/lib/commands/simply/permissions/build.d.ts +23 -4
- package/lib/commands/simply/permissions/build.js +64 -14
- package/lib/commands/simply/permissions/build.js.map +1 -1
- package/messages/simply.permissions.build.md +29 -7
- package/oclif.manifest.json +11 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ FLAG DESCRIPTIONS
|
|
|
66
66
|
The path to write the generated HTML report to.
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
_See code: [lib/commands/simply/permissions/analyze.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-permissions@1.
|
|
69
|
+
_See code: [lib/commands/simply/permissions/analyze.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-permissions@1.7.0/packages/simply-permissions/lib/commands/simply/permissions/analyze.js)_
|
|
70
70
|
|
|
71
71
|
## `sf simply permissions assignment delete`
|
|
72
72
|
|
|
@@ -109,7 +109,7 @@ EXAMPLES
|
|
|
109
109
|
$ sf simply permissions assignment delete --permission-set-group-name My_Permission_Set_Group --target-org myOrg
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
_See code: [lib/commands/simply/permissions/assignment/delete.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-permissions@1.
|
|
112
|
+
_See code: [lib/commands/simply/permissions/assignment/delete.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-permissions@1.7.0/packages/simply-permissions/lib/commands/simply/permissions/assignment/delete.js)_
|
|
113
113
|
|
|
114
114
|
## `sf simply permissions build`
|
|
115
115
|
|
|
@@ -156,6 +156,12 @@ DESCRIPTION
|
|
|
156
156
|
config/app.psbuild.json): that's how `sf simply cicd build check-permission-sets` finds permission sets files, and
|
|
157
157
|
this command warns about a file without it.
|
|
158
158
|
|
|
159
|
+
Run the command with neither --file nor any of the flags that describe a single permission set to build every
|
|
160
|
+
permission sets file under the current directory: every file whose name ends in .psbuild.json, skipping node_modules,
|
|
161
|
+
.git, .sf, and .sfdx. Every file is validated before anything is written, and the results table shows which file
|
|
162
|
+
declared each permission set. If no permission sets files are found, the command prints a warning and exits
|
|
163
|
+
successfully.
|
|
164
|
+
|
|
159
165
|
{
|
|
160
166
|
"defaults": {
|
|
161
167
|
"directory": "force-app",
|
|
@@ -197,6 +203,14 @@ EXAMPLES
|
|
|
197
203
|
|
|
198
204
|
$ sf simply permissions build --file config/app.psbuild.json --check
|
|
199
205
|
|
|
206
|
+
Regenerate every permission set declared in any .psbuild.json file under the current directory:
|
|
207
|
+
|
|
208
|
+
$ sf simply permissions build
|
|
209
|
+
|
|
210
|
+
Check every permission set declared in any .psbuild.json file under the current directory, without writing anything:
|
|
211
|
+
|
|
212
|
+
$ sf simply permissions build --check
|
|
213
|
+
|
|
200
214
|
FLAG DESCRIPTIONS
|
|
201
215
|
-c, --config=<value> Path to a permission set configuration file
|
|
202
216
|
|
|
@@ -205,26 +219,27 @@ FLAG DESCRIPTIONS
|
|
|
205
219
|
|
|
206
220
|
-d, --directory=<value> Path to the Salesforce project directory
|
|
207
221
|
|
|
208
|
-
The path to the Salesforce source directory to scan for custom objects, fields, tabs, and record types. Required
|
|
209
|
-
|
|
222
|
+
The path to the Salesforce source directory to scan for custom objects, fields, tabs, and record types. Required to
|
|
223
|
+
build a single permission set.
|
|
210
224
|
|
|
211
225
|
-f, --file=<value> Path to a permission sets file declaring every permission set to generate
|
|
212
226
|
|
|
213
227
|
The path to a JSON file with a "permissionSets" array, each entry describing one permission set to generate ("name",
|
|
214
228
|
"type", and optionally "label", "description", "directory", "output", "includeRecordTypes", "config"), and an
|
|
215
229
|
optional "defaults" object. Name it with the .psbuild.json suffix; any other name works but prints a warning. Can't
|
|
216
|
-
be combined with the flags that describe a single permission set.
|
|
230
|
+
be combined with the flags that describe a single permission set. If you omit --file and those flags, every
|
|
231
|
+
.psbuild.json file under the current directory is built.
|
|
217
232
|
|
|
218
233
|
-n, --name=<value> API name for the permission set
|
|
219
234
|
|
|
220
|
-
The API name for the generated permission set; also used to derive the output filename. Required
|
|
221
|
-
|
|
235
|
+
The API name for the generated permission set; also used to derive the output filename. Required to build a single
|
|
236
|
+
permission set.
|
|
222
237
|
|
|
223
238
|
--check Check that the generated permission sets are up to date, without writing them
|
|
224
239
|
|
|
225
240
|
Instead of writing each permission set, compare what would be generated with the file already at its output path.
|
|
226
|
-
Exits with code 1 if any permission set has drifted or is missing. Works with --file
|
|
227
|
-
|
|
241
|
+
Exits with code 1 if any permission set has drifted or is missing. Works with --file, with the single-permission-set
|
|
242
|
+
flags, and with neither, which checks every .psbuild.json file under the current directory.
|
|
228
243
|
|
|
229
244
|
--include-record-types Include record type visibilities
|
|
230
245
|
|
|
@@ -232,16 +247,16 @@ FLAG DESCRIPTIONS
|
|
|
232
247
|
|
|
233
248
|
--output=<value> Output directory
|
|
234
249
|
|
|
235
|
-
The directory to write the generated permission set XML file to. Required
|
|
250
|
+
The directory to write the generated permission set XML file to. Required to build a single permission set.
|
|
236
251
|
|
|
237
252
|
--type=read-only|view-all|modify-all Baseline permission type
|
|
238
253
|
|
|
239
254
|
The baseline permission level to generate: 'read-only' grants read access to all discovered objects and fields,
|
|
240
255
|
'view-all' additionally grants view-all-records, and 'modify-all' grants full CRUD and modify-all-records access.
|
|
241
|
-
Required
|
|
256
|
+
Required to build a single permission set.
|
|
242
257
|
```
|
|
243
258
|
|
|
244
|
-
_See code: [lib/commands/simply/permissions/build.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-permissions@1.
|
|
259
|
+
_See code: [lib/commands/simply/permissions/build.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-permissions@1.7.0/packages/simply-permissions/lib/commands/simply/permissions/build.js)_
|
|
245
260
|
<!-- commandsstop -->
|
|
246
261
|
|
|
247
262
|
## Configuration Files
|
|
@@ -11,6 +11,13 @@ type PermissionsBuildEntry = PermissionSetBuildResult & {
|
|
|
11
11
|
export type PermissionsBuildResult = Omit<PermissionsBuildEntry, 'name'>;
|
|
12
12
|
/** With `--file`: one entry per permission set declared in the file, in file order. */
|
|
13
13
|
export type PermissionsBuildFileResult = PermissionsBuildEntry[];
|
|
14
|
+
/**
|
|
15
|
+
* With neither `--file` nor the single-permission-set flags: one entry per permission set in every
|
|
16
|
+
* discovered permission sets file, each with the `file` that declared it, in file then declaration order.
|
|
17
|
+
*/
|
|
18
|
+
export type PermissionsBuildDiscoverResult = Array<{
|
|
19
|
+
file: string;
|
|
20
|
+
} & PermissionsBuildEntry>;
|
|
14
21
|
/** `file` renamed to carry {@link PERMISSION_SETS_FILE_SUFFIX}: `.psbuild` before a `.json` extension, or the whole suffix appended. */
|
|
15
22
|
export declare function suffixedName(file: string): string;
|
|
16
23
|
/**
|
|
@@ -21,12 +28,14 @@ export declare function suffixedName(file: string): string;
|
|
|
21
28
|
* requires activation.
|
|
22
29
|
*
|
|
23
30
|
* With `--file`, generates every permission set declared in a JSON permission sets file instead,
|
|
24
|
-
* validating the whole file before writing anything.
|
|
31
|
+
* validating the whole file before writing anything. With neither `--file` nor the single-permission-set
|
|
32
|
+
* flags, does the same for every permission sets file under the current directory, validating all of
|
|
33
|
+
* them before writing anything.
|
|
25
34
|
*
|
|
26
35
|
* With `--check`, writes nothing: compares each permission set it would generate with the file
|
|
27
36
|
* already at its output path, and sets `process.exitCode = 1` if any has drifted or is missing.
|
|
28
37
|
*/
|
|
29
|
-
export default class PermissionsBuild extends SfCommand<PermissionsBuildResult | PermissionsBuildFileResult> {
|
|
38
|
+
export default class PermissionsBuild extends SfCommand<PermissionsBuildResult | PermissionsBuildFileResult | PermissionsBuildDiscoverResult> {
|
|
30
39
|
static readonly summary: string;
|
|
31
40
|
static readonly description: string;
|
|
32
41
|
static readonly examples: string[];
|
|
@@ -44,14 +53,24 @@ export default class PermissionsBuild extends SfCommand<PermissionsBuildResult |
|
|
|
44
53
|
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
45
54
|
};
|
|
46
55
|
/**
|
|
47
|
-
* @returns The output file path and object/field permission counts — or, with `--file`, one such entry (plus its name) per permission set
|
|
56
|
+
* @returns The output file path and object/field permission counts — or, with `--file`, one such entry (plus its name) per permission set,
|
|
57
|
+
* and with no file or single-permission-set flags, one per permission set in every discovered file (plus its name and file).
|
|
48
58
|
* With `--check`, each also has a `status`, and `process.exitCode` is set to 1 when any isn't `up-to-date`.
|
|
49
59
|
*/
|
|
50
|
-
run(): Promise<PermissionsBuildResult | PermissionsBuildFileResult>;
|
|
60
|
+
run(): Promise<PermissionsBuildResult | PermissionsBuildFileResult | PermissionsBuildDiscoverResult>;
|
|
51
61
|
/** Resolves the single-permission-set flags into a spec, reporting every missing required flag at once. */
|
|
52
62
|
private singleSpec;
|
|
63
|
+
/**
|
|
64
|
+
* Builds (or, with `check`, checks) every permission set in every permission sets file under the
|
|
65
|
+
* current directory. Every file is loaded and validated before anything is written. No files is a
|
|
66
|
+
* warning, not an error, so the command is safe to run in any repo.
|
|
67
|
+
*/
|
|
68
|
+
private buildDiscovered;
|
|
69
|
+
/** @param sources - With discovery, the permission sets file each spec came from, shown as a FILE column. */
|
|
53
70
|
private generate;
|
|
54
71
|
private check;
|
|
72
|
+
/** Prints one row per result, with a leading FILE column when `sources` gives each result's permission sets file. */
|
|
73
|
+
private printTable;
|
|
55
74
|
private readConfig;
|
|
56
75
|
private startSpinner;
|
|
57
76
|
}
|
|
@@ -15,21 +15,19 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Messages } from '@salesforce/core';
|
|
17
17
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
-
import { checkPermissionSets, generatePermissionSets, loadPermissionSetBuildConfig, loadPermissionSetsFile, PermissionSetBuildError, } from '@simplysf/simply-permissions-core';
|
|
18
|
+
import { checkPermissionSets, findPermissionSetsFiles, generatePermissionSets, loadPermissionSetBuildConfig, loadPermissionSetsFile, PERMISSION_SETS_FILE_SUFFIX, PermissionSetBuildError, } from '@simplysf/simply-permissions-core';
|
|
19
19
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
20
|
const messages = Messages.loadMessages('@simplysf/simply-permissions', 'simply.permissions.build');
|
|
21
|
-
/**
|
|
22
|
-
* The suffix that marks a permission sets file, which is how `sf simply cicd build check-permission-sets`
|
|
23
|
-
* finds them. Also defined in `simply-cicd`.
|
|
24
|
-
*/
|
|
25
|
-
const PERMISSION_SETS_FILE_SUFFIX = '.psbuild.json';
|
|
26
21
|
/** `file` renamed to carry {@link PERMISSION_SETS_FILE_SUFFIX}: `.psbuild` before a `.json` extension, or the whole suffix appended. */
|
|
27
22
|
export function suffixedName(file) {
|
|
28
23
|
return file.endsWith('.json')
|
|
29
24
|
? `${file.slice(0, -'.json'.length)}${PERMISSION_SETS_FILE_SUFFIX}`
|
|
30
25
|
: `${file}${PERMISSION_SETS_FILE_SUFFIX}`;
|
|
31
26
|
}
|
|
32
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The flags that describe a single permission set, and so can't be combined with `--file`. When
|
|
29
|
+
* neither `--file` nor any of these is given, every discovered permission sets file is built.
|
|
30
|
+
*/
|
|
33
31
|
const SINGLE_PERMISSION_SET_FLAGS = [
|
|
34
32
|
'type',
|
|
35
33
|
'name',
|
|
@@ -59,6 +57,18 @@ function toCliError(error) {
|
|
|
59
57
|
return messages.createError('error.directoryNotFound', error.args);
|
|
60
58
|
}
|
|
61
59
|
}
|
|
60
|
+
/** Loads a discovered permission sets file, naming the file in any validation error. */
|
|
61
|
+
async function loadDiscoveredFile(file) {
|
|
62
|
+
try {
|
|
63
|
+
return await loadPermissionSetsFile(file);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (error instanceof PermissionSetBuildError) {
|
|
67
|
+
throw messages.createError('error.invalidPermissionSetsFile', [file, toCliError(error).message]);
|
|
68
|
+
}
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
62
72
|
/**
|
|
63
73
|
* Scans a Salesforce project directory for custom objects, fields, tabs, and (optionally)
|
|
64
74
|
* record types, then generates a permission set XML file with a baseline of permissions
|
|
@@ -67,7 +77,9 @@ function toCliError(error) {
|
|
|
67
77
|
* requires activation.
|
|
68
78
|
*
|
|
69
79
|
* With `--file`, generates every permission set declared in a JSON permission sets file instead,
|
|
70
|
-
* validating the whole file before writing anything.
|
|
80
|
+
* validating the whole file before writing anything. With neither `--file` nor the single-permission-set
|
|
81
|
+
* flags, does the same for every permission sets file under the current directory, validating all of
|
|
82
|
+
* them before writing anything.
|
|
71
83
|
*
|
|
72
84
|
* With `--check`, writes nothing: compares each permission set it would generate with the file
|
|
73
85
|
* already at its output path, and sets `process.exitCode = 1` if any has drifted or is missing.
|
|
@@ -130,13 +142,17 @@ export default class PermissionsBuild extends SfCommand {
|
|
|
130
142
|
}),
|
|
131
143
|
};
|
|
132
144
|
/**
|
|
133
|
-
* @returns The output file path and object/field permission counts — or, with `--file`, one such entry (plus its name) per permission set
|
|
145
|
+
* @returns The output file path and object/field permission counts — or, with `--file`, one such entry (plus its name) per permission set,
|
|
146
|
+
* and with no file or single-permission-set flags, one per permission set in every discovered file (plus its name and file).
|
|
134
147
|
* With `--check`, each also has a `status`, and `process.exitCode` is set to 1 when any isn't `up-to-date`.
|
|
135
148
|
*/
|
|
136
149
|
async run() {
|
|
137
150
|
const { flags } = await this.parse(PermissionsBuild);
|
|
138
151
|
try {
|
|
139
152
|
const { file } = flags;
|
|
153
|
+
if (!file && !SINGLE_PERMISSION_SET_FLAGS.some((flag) => flags[flag])) {
|
|
154
|
+
return await this.buildDiscovered(flags.check);
|
|
155
|
+
}
|
|
140
156
|
if (file && !file.endsWith(PERMISSION_SETS_FILE_SUFFIX)) {
|
|
141
157
|
this.warn(messages.getMessage('warning.unsuffixedFile', [file, suffixedName(file)]));
|
|
142
158
|
}
|
|
@@ -176,11 +192,37 @@ export default class PermissionsBuild extends SfCommand {
|
|
|
176
192
|
},
|
|
177
193
|
];
|
|
178
194
|
}
|
|
179
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Builds (or, with `check`, checks) every permission set in every permission sets file under the
|
|
197
|
+
* current directory. Every file is loaded and validated before anything is written. No files is a
|
|
198
|
+
* warning, not an error, so the command is safe to run in any repo.
|
|
199
|
+
*/
|
|
200
|
+
async buildDiscovered(check) {
|
|
201
|
+
const files = await findPermissionSetsFiles();
|
|
202
|
+
if (files.length === 0) {
|
|
203
|
+
this.warn(messages.getMessage('warning.noFilesFound'));
|
|
204
|
+
return [];
|
|
205
|
+
}
|
|
206
|
+
this.info(messages.getMessage('info.filesFound', [files.length]));
|
|
207
|
+
const specs = [];
|
|
208
|
+
const sources = [];
|
|
209
|
+
await this.readConfig(async () => {
|
|
210
|
+
for (const file of files) {
|
|
211
|
+
// eslint-disable-next-line no-await-in-loop -- files are loaded in order so the first invalid one is the one reported
|
|
212
|
+
const loaded = await loadDiscoveredFile(file);
|
|
213
|
+
specs.push(...loaded);
|
|
214
|
+
sources.push(...loaded.map(() => file));
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
const results = check ? await this.check(specs, sources) : await this.generate(specs, true, sources);
|
|
218
|
+
return results.map((result, i) => ({ file: sources[i], ...result }));
|
|
219
|
+
}
|
|
220
|
+
/** @param sources - With discovery, the permission sets file each spec came from, shown as a FILE column. */
|
|
221
|
+
async generate(specs, asTable, sources) {
|
|
180
222
|
const results = await generatePermissionSets(specs, (name) => this.startSpinner('info.buildingPermissionSet', name));
|
|
181
223
|
this.spinner.stop();
|
|
182
|
-
if (
|
|
183
|
-
this.
|
|
224
|
+
if (asTable) {
|
|
225
|
+
this.printTable(results, sources);
|
|
184
226
|
this.info(messages.getMessage('info.filesGenerated', [results.length]));
|
|
185
227
|
}
|
|
186
228
|
else {
|
|
@@ -188,10 +230,10 @@ export default class PermissionsBuild extends SfCommand {
|
|
|
188
230
|
}
|
|
189
231
|
return results;
|
|
190
232
|
}
|
|
191
|
-
async check(specs) {
|
|
233
|
+
async check(specs, sources) {
|
|
192
234
|
const results = await checkPermissionSets(specs, (name) => this.startSpinner('info.checkingPermissionSet', name));
|
|
193
235
|
this.spinner.stop();
|
|
194
|
-
this.
|
|
236
|
+
this.printTable(results, sources, [{ key: 'status', name: 'STATUS' }]);
|
|
195
237
|
const stale = results.filter((result) => result.status !== 'up-to-date').length;
|
|
196
238
|
if (stale > 0) {
|
|
197
239
|
this.warn(messages.getMessage('warning.drifted', [stale, results.length]));
|
|
@@ -202,6 +244,14 @@ export default class PermissionsBuild extends SfCommand {
|
|
|
202
244
|
}
|
|
203
245
|
return results;
|
|
204
246
|
}
|
|
247
|
+
/** Prints one row per result, with a leading FILE column when `sources` gives each result's permission sets file. */
|
|
248
|
+
printTable(results, sources, extraColumns = []) {
|
|
249
|
+
const fileColumn = sources ? [{ key: 'file', name: 'FILE' }] : [];
|
|
250
|
+
this.table({
|
|
251
|
+
data: results.map((result, i) => ({ file: sources?.[i], ...result })),
|
|
252
|
+
columns: [...fileColumn, ...TABLE_COLUMNS, ...extraColumns],
|
|
253
|
+
});
|
|
254
|
+
}
|
|
205
255
|
async readConfig(load) {
|
|
206
256
|
this.spinner.start(messages.getMessage('info.readingConfig'));
|
|
207
257
|
const loaded = await load();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../src/commands/simply/permissions/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,GAKxB,MAAM,mCAAmC,CAAC;AAE3C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAA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,EAClB,eAAqC,EAAE;QAEvC,MAAM,UAAU,GAAyB,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,IAAI,CAAC,KAAK,CAAC;YACT,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;YACrE,OAAO,EAAE,CAAC,GAAG,UAAU,EAAE,GAAG,aAAa,EAAE,GAAG,YAAY,CAAC;SAC5D,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,UAAU,CAAI,IAAsB;QAChD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,YAAY,CAAC,GAAW,EAAE,IAAY;QAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC"}
|
|
@@ -8,6 +8,8 @@ Scans a Salesforce project directory for custom objects, fields, tabs, and (opti
|
|
|
8
8
|
|
|
9
9
|
To regenerate every permission set in a project with one command, declare them all in a JSON file and pass it with --file instead of the other flags. Each entry in the file's "permissionSets" array takes the same settings as one run of this command; a top-level "defaults" object supplies the "directory", "output", and "includeRecordTypes" values shared by every entry, and any entry can override them. An entry's "config" is either a path to a --config file or the same overrides inline. Relative paths are resolved against the current directory, as they are for flags. The whole file, including referenced override files and source directories, is validated before anything is written, and each source directory is scanned only once. Name the file with the .psbuild.json suffix (for example config/app.psbuild.json): that's how `sf simply cicd build check-permission-sets` finds permission sets files, and this command warns about a file without it.
|
|
10
10
|
|
|
11
|
+
Run the command with neither --file nor any of the flags that describe a single permission set to build every permission sets file under the current directory: every file whose name ends in .psbuild.json, skipping node_modules, .git, .sf, and .sfdx. Every file is validated before anything is written, and the results table shows which file declared each permission set. If no permission sets files are found, the command prints a warning and exits successfully.
|
|
12
|
+
|
|
11
13
|
{
|
|
12
14
|
"defaults": {
|
|
13
15
|
"directory": "force-app",
|
|
@@ -38,7 +40,7 @@ Path to a permission sets file declaring every permission set to generate
|
|
|
38
40
|
|
|
39
41
|
# flags.file.description
|
|
40
42
|
|
|
41
|
-
The path to a JSON file with a "permissionSets" array, each entry describing one permission set to generate ("name", "type", and optionally "label", "description", "directory", "output", "includeRecordTypes", "config"), and an optional "defaults" object. Name it with the .psbuild.json suffix; any other name works but prints a warning. Can't be combined with the flags that describe a single permission set.
|
|
43
|
+
The path to a JSON file with a "permissionSets" array, each entry describing one permission set to generate ("name", "type", and optionally "label", "description", "directory", "output", "includeRecordTypes", "config"), and an optional "defaults" object. Name it with the .psbuild.json suffix; any other name works but prints a warning. Can't be combined with the flags that describe a single permission set. If you omit --file and those flags, every .psbuild.json file under the current directory is built.
|
|
42
44
|
|
|
43
45
|
# flags.type.summary
|
|
44
46
|
|
|
@@ -46,7 +48,7 @@ Baseline permission type
|
|
|
46
48
|
|
|
47
49
|
# flags.type.description
|
|
48
50
|
|
|
49
|
-
The baseline permission level to generate: 'read-only' grants read access to all discovered objects and fields, 'view-all' additionally grants view-all-records, and 'modify-all' grants full CRUD and modify-all-records access. Required
|
|
51
|
+
The baseline permission level to generate: 'read-only' grants read access to all discovered objects and fields, 'view-all' additionally grants view-all-records, and 'modify-all' grants full CRUD and modify-all-records access. Required to build a single permission set.
|
|
50
52
|
|
|
51
53
|
# flags.name.summary
|
|
52
54
|
|
|
@@ -54,7 +56,7 @@ API name for the permission set
|
|
|
54
56
|
|
|
55
57
|
# flags.name.description
|
|
56
58
|
|
|
57
|
-
The API name for the generated permission set; also used to derive the output filename. Required
|
|
59
|
+
The API name for the generated permission set; also used to derive the output filename. Required to build a single permission set.
|
|
58
60
|
|
|
59
61
|
# flags.directory.summary
|
|
60
62
|
|
|
@@ -62,7 +64,7 @@ Path to the Salesforce project directory
|
|
|
62
64
|
|
|
63
65
|
# flags.directory.description
|
|
64
66
|
|
|
65
|
-
The path to the Salesforce source directory to scan for custom objects, fields, tabs, and record types. Required
|
|
67
|
+
The path to the Salesforce source directory to scan for custom objects, fields, tabs, and record types. Required to build a single permission set.
|
|
66
68
|
|
|
67
69
|
# flags.config.summary
|
|
68
70
|
|
|
@@ -78,7 +80,7 @@ Output directory
|
|
|
78
80
|
|
|
79
81
|
# flags.output.description
|
|
80
82
|
|
|
81
|
-
The directory to write the generated permission set XML file to. Required
|
|
83
|
+
The directory to write the generated permission set XML file to. Required to build a single permission set.
|
|
82
84
|
|
|
83
85
|
# flags.include-record-types.summary
|
|
84
86
|
|
|
@@ -102,7 +104,7 @@ Check that the generated permission sets are up to date, without writing them
|
|
|
102
104
|
|
|
103
105
|
# flags.check.description
|
|
104
106
|
|
|
105
|
-
Instead of writing each permission set, compare what would be generated with the file already at its output path. Exits with code 1 if any permission set has drifted or is missing. Works with --file
|
|
107
|
+
Instead of writing each permission set, compare what would be generated with the file already at its output path. Exits with code 1 if any permission set has drifted or is missing. Works with --file, with the single-permission-set flags, and with neither, which checks every .psbuild.json file under the current directory.
|
|
106
108
|
|
|
107
109
|
# examples
|
|
108
110
|
|
|
@@ -118,9 +120,21 @@ Instead of writing each permission set, compare what would be generated with the
|
|
|
118
120
|
|
|
119
121
|
<%= config.bin %> <%= command.id %> --file config/app.psbuild.json --check
|
|
120
122
|
|
|
123
|
+
- Regenerate every permission set declared in any .psbuild.json file under the current directory:
|
|
124
|
+
|
|
125
|
+
<%= config.bin %> <%= command.id %>
|
|
126
|
+
|
|
127
|
+
- Check every permission set declared in any .psbuild.json file under the current directory, without writing anything:
|
|
128
|
+
|
|
129
|
+
<%= config.bin %> <%= command.id %> --check
|
|
130
|
+
|
|
121
131
|
# error.missingRequiredFlags
|
|
122
132
|
|
|
123
|
-
Missing required flag(s): %s. Provide them,
|
|
133
|
+
Missing required flag(s): %s. Provide them, use --file to build every permission set declared in a permission sets file, or omit all of the single permission set flags to build every .psbuild.json file under the current directory.
|
|
134
|
+
|
|
135
|
+
# error.invalidPermissionSetsFile
|
|
136
|
+
|
|
137
|
+
Permission sets file %s: %s
|
|
124
138
|
|
|
125
139
|
# error.invalidConfig
|
|
126
140
|
|
|
@@ -154,6 +168,10 @@ Permission set successfully generated at %s
|
|
|
154
168
|
|
|
155
169
|
Successfully generated %s permission set(s).
|
|
156
170
|
|
|
171
|
+
# info.filesFound
|
|
172
|
+
|
|
173
|
+
Found %s permission sets file(s).
|
|
174
|
+
|
|
157
175
|
# info.checkingPermissionSet
|
|
158
176
|
|
|
159
177
|
Checking permission set %s...
|
|
@@ -166,6 +184,10 @@ All %s permission set(s) are up to date.
|
|
|
166
184
|
|
|
167
185
|
%s of %s permission set(s) have drifted from their source metadata or are missing. Run this command without --check to regenerate them.
|
|
168
186
|
|
|
187
|
+
# warning.noFilesFound
|
|
188
|
+
|
|
189
|
+
No permission sets files (files ending in .psbuild.json) found under the current directory. Nothing to build.
|
|
190
|
+
|
|
169
191
|
# warning.unsuffixedFile
|
|
170
192
|
|
|
171
193
|
%s doesn't end in .psbuild.json, so `sf simply cicd build check-permission-sets` won't find it. Rename it to %s.
|
package/oclif.manifest.json
CHANGED
|
@@ -90,12 +90,14 @@
|
|
|
90
90
|
"simply:permissions:build": {
|
|
91
91
|
"aliases": [],
|
|
92
92
|
"args": {},
|
|
93
|
-
"description": "Scans a Salesforce project directory for custom objects, fields, tabs, and (optionally) record types, then generates a permission set XML file with a baseline of permissions determined by --type. An optional JSON --config file can override individual object, field, tab, record type, and user permission settings, as well as whether the permission set requires activation.\n\nTo regenerate every permission set in a project with one command, declare them all in a JSON file and pass it with --file instead of the other flags. Each entry in the file's \"permissionSets\" array takes the same settings as one run of this command; a top-level \"defaults\" object supplies the \"directory\", \"output\", and \"includeRecordTypes\" values shared by every entry, and any entry can override them. An entry's \"config\" is either a path to a --config file or the same overrides inline. Relative paths are resolved against the current directory, as they are for flags. The whole file, including referenced override files and source directories, is validated before anything is written, and each source directory is scanned only once. Name the file with the .psbuild.json suffix (for example config/app.psbuild.json): that's how `sf simply cicd build check-permission-sets` finds permission sets files, and this command warns about a file without it.\n\n {\n \"defaults\": {\n \"directory\": \"force-app\",\n \"output\": \"force-app/main/default/permissionsets\"\n },\n \"permissionSets\": [\n { \"name\": \"App_Read_Only\", \"type\": \"read-only\" },\n {\n \"name\": \"App_Admin\",\n \"type\": \"modify-all\",\n \"label\": \"App Admin\",\n \"includeRecordTypes\": true,\n \"config\": \"config/app-admin-overrides.json\"\n },\n {\n \"name\": \"App_Support\",\n \"type\": \"view-all\",\n \"config\": { \"userPermissions\": { \"ViewSetup\": true } }\n }\n ]\n }\n\nTo check in CI that the committed permission sets still match their source metadata, add --check. It builds each permission set as usual but writes nothing: it compares each one with the file already at its output path and reports it as \"up-to-date\", \"drifted\", or \"missing\". If any permission set has drifted or is missing, the command exits with code 1. Formatting differences, such as indentation, line endings, or comments, don't count as drift, so files reformatted by Prettier still pass. Any other difference does, including hand edits and reordered entries.",
|
|
93
|
+
"description": "Scans a Salesforce project directory for custom objects, fields, tabs, and (optionally) record types, then generates a permission set XML file with a baseline of permissions determined by --type. An optional JSON --config file can override individual object, field, tab, record type, and user permission settings, as well as whether the permission set requires activation.\n\nTo regenerate every permission set in a project with one command, declare them all in a JSON file and pass it with --file instead of the other flags. Each entry in the file's \"permissionSets\" array takes the same settings as one run of this command; a top-level \"defaults\" object supplies the \"directory\", \"output\", and \"includeRecordTypes\" values shared by every entry, and any entry can override them. An entry's \"config\" is either a path to a --config file or the same overrides inline. Relative paths are resolved against the current directory, as they are for flags. The whole file, including referenced override files and source directories, is validated before anything is written, and each source directory is scanned only once. Name the file with the .psbuild.json suffix (for example config/app.psbuild.json): that's how `sf simply cicd build check-permission-sets` finds permission sets files, and this command warns about a file without it.\n\nRun the command with neither --file nor any of the flags that describe a single permission set to build every permission sets file under the current directory: every file whose name ends in .psbuild.json, skipping node_modules, .git, .sf, and .sfdx. Every file is validated before anything is written, and the results table shows which file declared each permission set. If no permission sets files are found, the command prints a warning and exits successfully.\n\n {\n \"defaults\": {\n \"directory\": \"force-app\",\n \"output\": \"force-app/main/default/permissionsets\"\n },\n \"permissionSets\": [\n { \"name\": \"App_Read_Only\", \"type\": \"read-only\" },\n {\n \"name\": \"App_Admin\",\n \"type\": \"modify-all\",\n \"label\": \"App Admin\",\n \"includeRecordTypes\": true,\n \"config\": \"config/app-admin-overrides.json\"\n },\n {\n \"name\": \"App_Support\",\n \"type\": \"view-all\",\n \"config\": { \"userPermissions\": { \"ViewSetup\": true } }\n }\n ]\n }\n\nTo check in CI that the committed permission sets still match their source metadata, add --check. It builds each permission set as usual but writes nothing: it compares each one with the file already at its output path and reports it as \"up-to-date\", \"drifted\", or \"missing\". If any permission set has drifted or is missing, the command exits with code 1. Formatting differences, such as indentation, line endings, or comments, don't count as drift, so files reformatted by Prettier still pass. Any other difference does, including hand edits and reordered entries.",
|
|
94
94
|
"examples": [
|
|
95
95
|
"<%= config.bin %> <%= command.id %> --type read-only --name My_Read_Only_Access --directory force-app --output force-app/main/default/permissionsets",
|
|
96
96
|
"<%= config.bin %> <%= command.id %> --type modify-all --name My_Admin_Access --directory force-app --config config/permission-overrides.json --output force-app/main/default/permissionsets --include-record-types",
|
|
97
97
|
"Regenerate every permission set declared in a permission sets file:\n<%= config.bin %> <%= command.id %> --file config/app.psbuild.json",
|
|
98
|
-
"In CI, fail if any permission set declared in a permission sets file needs to be regenerated:\n<%= config.bin %> <%= command.id %> --file config/app.psbuild.json --check"
|
|
98
|
+
"In CI, fail if any permission set declared in a permission sets file needs to be regenerated:\n<%= config.bin %> <%= command.id %> --file config/app.psbuild.json --check",
|
|
99
|
+
"Regenerate every permission set declared in any .psbuild.json file under the current directory:\n<%= config.bin %> <%= command.id %>",
|
|
100
|
+
"Check every permission set declared in any .psbuild.json file under the current directory, without writing anything:\n<%= config.bin %> <%= command.id %> --check"
|
|
99
101
|
],
|
|
100
102
|
"flags": {
|
|
101
103
|
"json": {
|
|
@@ -115,7 +117,7 @@
|
|
|
115
117
|
},
|
|
116
118
|
"file": {
|
|
117
119
|
"char": "f",
|
|
118
|
-
"description": "The path to a JSON file with a \"permissionSets\" array, each entry describing one permission set to generate (\"name\", \"type\", and optionally \"label\", \"description\", \"directory\", \"output\", \"includeRecordTypes\", \"config\"), and an optional \"defaults\" object. Name it with the .psbuild.json suffix; any other name works but prints a warning. Can't be combined with the flags that describe a single permission set.",
|
|
120
|
+
"description": "The path to a JSON file with a \"permissionSets\" array, each entry describing one permission set to generate (\"name\", \"type\", and optionally \"label\", \"description\", \"directory\", \"output\", \"includeRecordTypes\", \"config\"), and an optional \"defaults\" object. Name it with the .psbuild.json suffix; any other name works but prints a warning. Can't be combined with the flags that describe a single permission set. If you omit --file and those flags, every .psbuild.json file under the current directory is built.",
|
|
119
121
|
"exclusive": [
|
|
120
122
|
"type",
|
|
121
123
|
"name",
|
|
@@ -133,7 +135,7 @@
|
|
|
133
135
|
"type": "option"
|
|
134
136
|
},
|
|
135
137
|
"type": {
|
|
136
|
-
"description": "The baseline permission level to generate: 'read-only' grants read access to all discovered objects and fields, 'view-all' additionally grants view-all-records, and 'modify-all' grants full CRUD and modify-all-records access. Required
|
|
138
|
+
"description": "The baseline permission level to generate: 'read-only' grants read access to all discovered objects and fields, 'view-all' additionally grants view-all-records, and 'modify-all' grants full CRUD and modify-all-records access. Required to build a single permission set.",
|
|
137
139
|
"name": "type",
|
|
138
140
|
"summary": "Baseline permission type",
|
|
139
141
|
"hasDynamicHelp": false,
|
|
@@ -147,7 +149,7 @@
|
|
|
147
149
|
},
|
|
148
150
|
"name": {
|
|
149
151
|
"char": "n",
|
|
150
|
-
"description": "The API name for the generated permission set; also used to derive the output filename. Required
|
|
152
|
+
"description": "The API name for the generated permission set; also used to derive the output filename. Required to build a single permission set.",
|
|
151
153
|
"name": "name",
|
|
152
154
|
"summary": "API name for the permission set",
|
|
153
155
|
"hasDynamicHelp": false,
|
|
@@ -156,7 +158,7 @@
|
|
|
156
158
|
},
|
|
157
159
|
"directory": {
|
|
158
160
|
"char": "d",
|
|
159
|
-
"description": "The path to the Salesforce source directory to scan for custom objects, fields, tabs, and record types. Required
|
|
161
|
+
"description": "The path to the Salesforce source directory to scan for custom objects, fields, tabs, and record types. Required to build a single permission set.",
|
|
160
162
|
"name": "directory",
|
|
161
163
|
"summary": "Path to the Salesforce project directory",
|
|
162
164
|
"hasDynamicHelp": false,
|
|
@@ -173,7 +175,7 @@
|
|
|
173
175
|
"type": "option"
|
|
174
176
|
},
|
|
175
177
|
"output": {
|
|
176
|
-
"description": "The directory to write the generated permission set XML file to. Required
|
|
178
|
+
"description": "The directory to write the generated permission set XML file to. Required to build a single permission set.",
|
|
177
179
|
"name": "output",
|
|
178
180
|
"summary": "Output directory",
|
|
179
181
|
"hasDynamicHelp": false,
|
|
@@ -202,7 +204,7 @@
|
|
|
202
204
|
"type": "option"
|
|
203
205
|
},
|
|
204
206
|
"check": {
|
|
205
|
-
"description": "Instead of writing each permission set, compare what would be generated with the file already at its output path. Exits with code 1 if any permission set has drifted or is missing. Works with --file
|
|
207
|
+
"description": "Instead of writing each permission set, compare what would be generated with the file already at its output path. Exits with code 1 if any permission set has drifted or is missing. Works with --file, with the single-permission-set flags, and with neither, which checks every .psbuild.json file under the current directory.",
|
|
206
208
|
"name": "check",
|
|
207
209
|
"summary": "Check that the generated permission sets are up to date, without writing them",
|
|
208
210
|
"allowNo": false,
|
|
@@ -348,5 +350,5 @@
|
|
|
348
350
|
]
|
|
349
351
|
}
|
|
350
352
|
},
|
|
351
|
-
"version": "1.
|
|
353
|
+
"version": "1.7.0"
|
|
352
354
|
}
|
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.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply-plugins",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply-plugins/issues",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@salesforce/sf-plugins-core": "^12.2.16",
|
|
63
63
|
"@salesforce/source-deploy-retrieve": "^12.37.2",
|
|
64
64
|
"@simplysf/simply-core": "^1.6.7",
|
|
65
|
-
"@simplysf/simply-permissions-core": "^0.
|
|
65
|
+
"@simplysf/simply-permissions-core": "^0.6.0",
|
|
66
66
|
"@simplysf/simply-plugin-kit": "^1.0.9",
|
|
67
67
|
"zod": "^4.6.5"
|
|
68
68
|
},
|
|
@@ -202,5 +202,5 @@
|
|
|
202
202
|
"output": []
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
|
-
"gitHead": "
|
|
205
|
+
"gitHead": "970835763c6ff199a1a853eec344807f35e3315c"
|
|
206
206
|
}
|