This project is read-only.

MySiteCreate 1.0 Issue

Apr 3, 2009 at 3:52 PM
I've installed the MySiteCreate 1.0 feature on a MOSS 2007 SP1 environment.  I've configured it and was able to use a custom master page for mysite.  I have noticed one issue that I wonder if anyone else has experienced.  After installing the feature whenever you browse a user that hasn't created a mysite. I get a message that Access is Denied and the person.aspx page does not open.  If you login with the Administrator account you are able to view the person.aspx page no problem.  After uninstalling the feature and changing the default master page for person.aspx back to the original; everything works fine.  As soon as I install the feature again and use the use the custom master page it causes the problem. 

I aslo noticed that if I change the permission for NT AUTHORITY\authenticated on the MySite from Read to Contribute, the error does not occur.  I can view the person.aspx page for users that have not created a mysite.

Has anyone else experienced this?  More importantly does anyone know why a user with Reader access cannot view the person.aspx page using this feature?

Apr 6, 2009 at 6:30 PM
Edited Apr 6, 2009 at 6:31 PM
After further digging around I discovered that the error was being generated when executing the following line in the PartCheck.cs code for the MySiteCreatePart.

SPFile thePage = curWeb.RootFolder.Files["default.aspx"];

For some reason a user that has read access to MySite cannot call the RootFolder or Files Properties. In my testing the user required Contribute access or higher for this to work at least on the MySite Application.

I added the following code to the MySiteCreatePart in the PartCheck.cs file to get around this issue.

//get the current Site
SPSite curSite = SPContext.Current.Site;

//Only execute this code if the we are not in the root site
//We are in a users mysite.
if (curSite.ServerRelativeUrl.ToString() != "/")

    SPFile thePage = curWeb.RootFolder.Files["default.aspx"];

        if (thePage != null)

              < Rest of code unchanged >       



Compile and re-register the MySiteCreatePart. There might be a better solution (maybe checking if the RootFolder is not null or something) but this seems to have resolved the issue for my company.  Everything seems to work ok and there are no errors being reported in the event log.