1

Initially we have released a package with Public Read/Write access to the packaged object. We want to change the sharing model to Private. However, when releasing a new package version with Private sharing model, this doesn't effect existing subscriber's org where the previous value of sharing is kept.

Can we leverage Post Install script to change the sharing model for package upgrade?

Is this possible to change OWD for packaged object to Private in the package update?

1 Answer 1

1

Can we leverage Post Install script to change the sharing model for package upgrade?

No, you can't get a session Id in that context that you could use to call the Metadata API. (Plus, it's a really dangerous idea that could cause a variety of undesirable behaviors in subscriber orgs).

Is this possible to change OWD for packaged object to Private in the package update?

No. Per the documentation, the Default Sharing Model facet of the CustomObject is both subscriber- and developer-editable, which means your changes will deliver to new subscribers but will not push-upgrade to existing subscribers.


Changing an object's sharing model is a potential breaking change, which is exactly what manageability rules are designed to protect against. You'll have to manage this change with subscriber education rather than technical solutions.

2
  • Could you please expand more about why such a change may be a breaking change and dangerous?
    – Patlatus
    Commented Jan 17, 2022 at 18:51
  • Subscriber has built automation that runs with sharing but silently expects your object to have a Public sharing model is likely to break.
    – David Reed
    Commented Jan 17, 2022 at 18:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .