apex-enterprise-patterns / fflib-apex-common

Common Apex Library supporting Apex Enterprise Patterns and much more!
BSD 3-Clause "New" or "Revised" License
899 stars 514 forks source link

UOW : Allow setting sharing mode for unit of work #475

Closed adtungadi closed 6 months ago

adtungadi commented 7 months ago

Since unit of work class has no sharing declaration, it would inherit the sharing of the calling class regardless of it running in system mode. This change gives a flexibility to set the uow sharing mode, independent of the calling class.


This change is Reviewable

ImJohnMDaniel commented 6 months ago

G'day @adtungadi -- Thanks for opening this PR. We have reviewed the change and have decided against merging this into the code base. The reasons for this decision are that we see Salesforce's User mode is the better approach to manage this need and Class-based sharing declarations are not as preferred by Salesforce now. We also have reservations about causing unnecessary confusion with the Apex Common user base as the UOW is one of the foundational elements of the framework and we don't wish to deviate from Salesforce's direction in this question. Again, thank you for your help and suggestion with this change. We do appreciate it. Cheers!