Restricting access to pages such as AllItems.aspx, EditForm.aspx in MOSS

Friday, March 19, 2010

In Moss 2007 we have the pages such as AllItems.aspx which are used to view the contents of a List or a document Library. Similary, the page AllForms.aspx is used to view all the Forms in a Forms Library. So as we have other pages Editform.aspx, DispForm.aspx.

Now if you have enabled anonynmous access on your system, then these forms are viewable for all the users, no matter if they are registered users or not, by simply typing the url.

However, these pages should be viewable only for the Admin users. So what's the trick?

One way is to go to each of these forms and add server side code blocks to check if the current user is Admin or not and depending on that redirect them to home page or may be login page in case of anonymous users. That's what i did initiall, but later found out an easy out-of-the-box solution available with Sharepoint 2007.

This issue is resolved using the feature called ViewFormsPagesLockdown Feature. This lockdown feature is enabled using the stsadm command as below:

stsadm.exe –o activatefeature –url -filename ViewFormPagesLockdown\feature.xml


You may have to first switch to the bin directory containing stsadm.exe and then change the text with your site collection's URL. Also, you may have to give the full path for the feature ViewFormPagesLockdown\feature.xml.

After you run this command, disable the anonymous access and enable it back again.

In case you want to go deep into this feature then follow this MSDN Blog Post.

VSTS: Failed to queue test run Error : Unable to find assembly Smartdevice

Tuesday, March 2, 2010

During my stint with Load Tests in Visual Studio Team System, I was able to successfully run my Load Test, but after i configured the Rig and edited the configuration file i started getting following error whenever i ran the test.

Failed to queue test run Unable to find assembly 'Microsoft.VisualStudio.SmartDevice.TestHostAdapter

After trying various things i finally found out it has to do with the Hosts entry in the configuration file. There exists an entry for Smart Device under Hosts section in the local configuration file.

To solve this issue follow the following steps:

  1. In Solution Explorer, under Solution Items, right-click the test run configuration file (file with extension .testrunconfig) and then click Open With.
  2. Choose a program to open the file, such as XML Editor, and then click OK.
  3. Remove or comment the following entry (marked in red) for Smart Device under Hosts section


<hosts>
<devicehostrunconfigdata name="Smart Device" deviceid="AE1FD546-ECB8-4553-B0AA-53E129544859" devicename="Pocket PC 2003 Device" platformid="3C41C503-53EF-4c2a-8DD4-A8217CAD115E" platformname="Pocket PC 2003" uiplatformid="00000000-0000-0000-0000-000000000000"></devicehostrunconfigdata>
</hosts>

Followers

 

2009 ·Techy Freak by TNB