I am hoping someone can shed some light on this for me. I am beyond confused.
I have Lightning Component that has some strings to build out a dynamic query in SOQL. It is against a custom object called 'Images__c'. Else where in the code I am having to query against the same object, but it is not through a dynamic query for various different reasons.
'Sales Person' profile does not have access to this object. When in the Lightning Component and I click the button that ends up making the dynamic query run and I am getting back a list of 'Image__c' objects. When I click the button to make the standard query run I am getting a hard error due to not having access as expected.
My question is does dynamic soql enforce profile object permissions? Why would one query work as expected and the other doesn't?
Edit: I should note that the dynamic soql just returns a list of generic sobjects all the way back to lightning.