Custom Object - OWD (public read only) Apex(no sharing specified) and the apex is the entry point Object level permission on profile is read
I was trying to update a custom object logging in as a user with custom profile that does has view/View all object permission.
I have a custom lightning component that calls an apex method. The apex method tries to update the custom object and i get the below error.
Update failed. First exception on row 0 with id a0rV0000001YtJuIAK; first error: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id: 
According to Salesforce documentation, Apex should be ignoring object level permission and be able to update the record.
I need to understand why this behaviour happens?
Custom object has OWD settings as "Public Read only" and there is no sharing rule.
The issue resolves if I add "Modify All" permission in the profile in the object level or if I change the OWD to public read write.
But in the apex class I did not specify sharing (which means it should behave as without sharing) and that is the entry point of the lightning component