@simplysf/simply-permissions 1.2.0 → 1.2.2
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 +135 -0
- package/package.json +10 -8
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 -->
|
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.2",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply/issues",
|
|
@@ -65,7 +65,9 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@oclif/plugin-command-snapshot": "^5.3.19",
|
|
68
|
-
"@salesforce/plugin-command-reference": "^3.1.99"
|
|
68
|
+
"@salesforce/plugin-command-reference": "^3.1.99",
|
|
69
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
70
|
+
"vitest": "^4.1.10"
|
|
69
71
|
},
|
|
70
72
|
"publishConfig": {
|
|
71
73
|
"access": "public"
|
|
@@ -79,9 +81,10 @@
|
|
|
79
81
|
"lint": "wireit",
|
|
80
82
|
"readme": "oclif readme --no-aliases",
|
|
81
83
|
"test": "wireit",
|
|
84
|
+
"test:coverage": "vitest run --coverage",
|
|
82
85
|
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --jobs 5",
|
|
83
86
|
"test:only": "wireit",
|
|
84
|
-
"test:watch": "
|
|
87
|
+
"test:watch": "vitest watch"
|
|
85
88
|
},
|
|
86
89
|
"wireit": {
|
|
87
90
|
"build": {
|
|
@@ -176,7 +179,7 @@
|
|
|
176
179
|
"output": []
|
|
177
180
|
},
|
|
178
181
|
"test:only": {
|
|
179
|
-
"command": "
|
|
182
|
+
"command": "vitest run",
|
|
180
183
|
"env": {
|
|
181
184
|
"FORCE_COLOR": "2"
|
|
182
185
|
},
|
|
@@ -184,9 +187,8 @@
|
|
|
184
187
|
"test/**/*.ts",
|
|
185
188
|
"src/**/*.ts",
|
|
186
189
|
"**/tsconfig.json",
|
|
187
|
-
".
|
|
188
|
-
"!*.nut.ts"
|
|
189
|
-
".nycrc"
|
|
190
|
+
"vitest.config.ts",
|
|
191
|
+
"!*.nut.ts"
|
|
190
192
|
],
|
|
191
193
|
"output": []
|
|
192
194
|
},
|
|
@@ -200,5 +202,5 @@
|
|
|
200
202
|
"output": []
|
|
201
203
|
}
|
|
202
204
|
},
|
|
203
|
-
"gitHead": "
|
|
205
|
+
"gitHead": "ddaa65ef57d74cbff83875acaec5e10beb7f77ba"
|
|
204
206
|
}
|