Related to System.runAs for CspLitePortal Profile Users recently started returning no rows, I am now wondering how to automate the setting of the external sharing model for some SObjects contained in managed packages that we automatically install in our CI scratch org.
My first thought was to use:
sfdx force:source:deploy --sourcepath config-components/externalSharingModel
to deploy just those flags for the relevant SObjects:
<?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <externalSharingModel>ReadWrite</externalSharingModel> </CustomObject>
but multiple other attributes seem to be required.
Is there a simple way to set the external sharing model values in a scratch org programmatically?
(All I can think of is read/modify/write via e.g. the apex-mdapi.)