New answers tagged access-denied
If you have disabled scripting from the SharePoint admin center Go to the SharePoint admin center Select Settings Under Custom Script choose: Prevent users from running custom script on personal sites or Allow users to run custom script on personal sites. Prevent users from running custom script on user created sites or Allow users to run custom script ...
You're making a query against a site you don't have access to. By definition, you do not have permission to view the data you are trying to fetch. If you want to get the current user's login name, just call _spPageContextInfo.userLoginName
Top 50 recent answers are included