-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sf org permset assign -b does not work with a User Alias #2551
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
This is working as designed. |
@shetzel thanks for the feedback, although I'm not sure that it makes sense to me. First, the help text uses different phrases for "alias" in each context ("org alias" vs "Username or alias".)
Second, since the
Note that using the org alias automatically sets the permission set to the username.
And it would not make much sense to provide a different org alias than that of the target org
In my opinion, it makes more sense to be able to automate the assignment of a permission set to a User's Alias across multiple environments since the username changes. Comparing the two examples below, the second one would potentially require querying the username in every sandbox environment:
vs
Thanks for the consideration. |
Both flag values are usernames or CLI aliases for usernames. All CLI commands that target Salesforce orgs act as the specified username, which comes from a config variable or explicitly set as a flag on the command. As part of creating a scratch org an admin user is also created and that is what the CLI uses for API requests. So "Scratch org alias" in the command help is referring to an alias that you can specify for the admin user when you create the scratch org. When assigning permsets, you can assign them to yourself (i.e., as the person executing the command) or you can assign the permset to another user (by username) in the target org. This way, you can create test users from the CLI that may not have permissions to assign permsets to themselves, so an admin user does it for them as part of setup steps. E.g., |
Summary
sf org permset assign -b
does not work with a User AliasSteps To Reproduce
Query for a User Alias:
Assigning the permission set on behalf of an alias results in an error:
Assigning the permission set on behalf of a username is successful:
Expected result
Per the command help, the
-b
flag should accept an Alias to indicate a User.Actual result
Assigning the permission set on behalf of an alias results in an error:
System Information
Additional information
The text was updated successfully, but these errors were encountered: