I am really confused about this one. I have done my share of research. In the documentation, it has been mentioned that
with sharing keyword is used to enforce sharing rules for the current user. It also mentions that using this keyword doesn't enforce field level security/FLS. I have read many blogs and many answers on stack exchange paltform as well, all contradicting each other. I have following doubts:
- When you use
with sharingkeyword in an apex class, and try to query an object which doesn't have read permission on the profile, what would happen? Would it still show some results?
- What happens when a user not having the access to some object tries to run select query on that object in query editor?
- I read that in SOQL, we need to use
WITH SECURITY_ENFORCEDto enforce FLS. What happens if you don't use this keyword in a class defined as
- If the
with sharingkeyword enforces profile level permissions, why would you use methods like
- I wanted to test these on my own, but any user other than system administrator is not able to see Developer Console option, even when I have API enabled checkbox checked. Does it have something to do with the license?
Please mention if there is any documentation that answers the above questions. Many thanks.