|
View Blog
Mar
14
Written by:
Stefan Kitzler-Walli
Saturday, March 14, 2009 11:56 AM
We at cubido usually create separate virtual machines for SharePoint projects as testing environment. These VMs are best fit to the customer’s environment depending on OS language, SharePoint Language and localizations, authentication …
Whether or not there is an Active Directory or not, most of the developers access these machines with the administrator’s account and so all code deployed to the SharePoint Server is running within this context.
To avoid errors arising from web parts, features or other components that can’t comply user contexts below administrator you should test your code as a normal user (read) or probably a contributor – whatever your testing needs are.
First you would create a new user with the proper rights within your SharePoint portal and login as this user. If you open your Browser now with the URL of the SharePoint Portal you will be logged in as this low-rights-user and can test your code within this context.
Now if you try to change some settings for the i.e. web part or the site you would have to switch to the administrator’s context – click on your account name in the right upper corner and choose “login as different person”. You can now logon as administrator and change the settings. Even if you do this within a new window of your browser i.e. Internet Explorer it will only keep the credentials of the user that last logged in. So using the browser where you last logged in as user will have the context of the administrator after a switch.
This switch from administrator to user is time consuming and annoying during development so here is how to do it with almost no effort.
Logon to the machine with the low-privilege-account and open your browser with the URL of the SharePoint portal. Now open the context menu of your browser in the start menu and select “Run as…”. Choose to run the application in the administrator’s context. Open the SharePoint portal and you’ll see you have administrator’s rights.
If you don’t give administrator rights to this user account, which is advised, you probably won’t be able to deploy new versions of your code. So do the same for a command shell and run it within the administrator’s context to do so depending on the deployment method you choose.
Tags:
|
Newsletter
Sie möchten im Newsletter über aktuelle technische Entwicklungen und Neuigkeiten rund um cubido informiert werden?
Newsletter abonnieren ...
|