I'm working on a project that needs to change a lot of data that the user shouldn't see in the backoffice. So I'm wondering if I should put my entire class "without sharing".
For now I'm creating a "without sharing" inner class for each class, but each soql part is in this part, because the user shouldn't change any data by himself.
@AuraEnabled
public static void deleteTime(SObject t) {
new InnerTimeManager().deleteSObject(new List<SObject>{t});
}
without sharing class InnerTimeManager {
public void deleteSObject(List<SObject> listSO) {
delete listSO;
}
}
All parts that need soql are like this. And I don't feel that it is useful. Is there any good practice for this kind of case?
FYI : I can't change user permissions and Sharing Settings are private.