This feature is in public preview.
Granting access to a user
Grant a role directly to a user by their email.production workspace.
As with other commands, -w and SF_WORKSPACE also set the workspace. --org overrides
SF_WORKSPACE, and can’t be combined with -w or --workspace.
Organization-wide grants
Use--org to grant a role across all workspaces in the organization.
Listing grants
List all grants in the organization. With a workspace set by-w or SF_WORKSPACE, the list shows
only the grants scoped to that workspace, not organization-wide ones.
sf grants create, which accepts an email, the --user
filter takes a user ID.
Deleting a grant
Delete a grant by its ID, whichsf grants list prints in the first column.
sf grants list, --user
takes a user ID.
Multiple grants
A user or token can have multiple grants. SF Compute combines the permissions from every granted role (a union).viewer access organization-wide and training-operator access in production.
Token grants
Grant roles to tokens for CI/CD pipelines and other automation.sf tokens create takes the same
--workspace and --org flags and creates 1 grant per role.