Querying objects as another user - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
K. Aristotelis SavasK. Aristotelis Savas 

Querying objects as another user

Random question that feels like it may have been answered somewhere on Google, but maybe I'm just not using the right search keywords?

If I Login As another user, and open the Developer console, is that console running in context of that Login As user, or as me as an Admin?

Asking because I'm trying to debug something involving access and I just did Login As an integration user, popped the Dev console, queried the objects successfully so I figured it couldn't be access related, then realized as soon as I opened the Dev console it re-opened tabs I've previously had open when logged in as myself (even since clearing my local HDD cache), and it warned me my personal debug log is full. That feels like it's running in my context, not the Login As user.

Can't find anything in the Dev console that tells me the context in which it's running.
Best Answer chosen by K. Aristotelis Savas
Usman AliUsman Ali
Hi,

That's true, If you logged in as another user and open developer console, then developer console will open in context of that user. 

All Answers

Karen SpenceKaren Spence
I have found that logging in as another user in Lightning is flawed. Not sure if you are using Lightning. I've seen the same issues you have and more. I cannot trust it.
Usman AliUsman Ali
Hi,

That's true, If you logged in as another user and open developer console, then developer console will open in context of that user. 
This was selected as the best answer
Lakhan MeghaniLakhan Meghani
Hi,

Good question and curious to know the end result
I am not sure but I think...
Well debug gets generated in the console based on logged in user action


You can generate all logs with the help of this help article-
https://help.salesforce.com/articleView?id=sf.code_add_users_debug_log.htm&type=5
Lakhan MeghaniLakhan Meghani
Might be the case that you logged in as a user from admin so it is considering all logs generated on behalf of admin!!!
K. Aristotelis SavasK. Aristotelis Savas
I just did a test in my own sandbox to satisfy my curiosity ... logged in as a user, tested a query, logged out as them, removed their access to the object, logged in as them again and re-ran the query - error. So the dev console definitely runs in context of the Login As user. Feels like if the other parts of the UX put a banner up saying "You're logged in as xxxx person," it should be all contexts of the UX and not just the main page.