According to Using the with sharing
, without sharing
, and inherited sharing
Keywords (emphasis mine):
- Both inner classes and outer classes can be declared as with sharing. The sharing setting applies to all code contained in the class, including initialization code, constructors, and methods.
- Inner classes do not inherit the sharing setting from their container class.
- Classes inherit this setting from a parent class when one class extends or implements another.
So yes, you need to declare sharing for each inner class as well.