Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Assign a Permission Set
After creating your scratch org and deploying the source, you must sometimes give your
users access to your application, especially if your app contains custom objects.
-
If needed, create the permission set in the scratch org.
-
Open the scratch org in your browser.
1sf org open --target-org <scratch org username/alias> - From Setup, enter Perm in the Quick Find box, then select Permission Sets.
- Click New.
- Enter a descriptive label for the permission set, then click Save.
- Under Apps, click .
- Under Available Apps, select your app, then click Add to move it to Enabled Apps.
- Click Save.
-
Open the scratch org in your browser.
-
Retrieve the permission set from the scratch org to your project.
1sf project retrieve start --target-org <scratch org username/alias> -
Assign the permission set to one or more users of the org that contains the app:
1sf org assign permset --name <permset_name> --target-org <username/alias>The target username must have permission to assign a permission set. Use the --on-behalf-of flag to assign a permission set to non-administrator users.
1sf org assign permset --name <permset_name> --target-org <admin-user> --on-behalf-of <non-admin-user>
You can also assign permission set licenses to users using the org assign permsetlicense command. It works similarly to the
org assign permset command.