none
Editing Page in Sharepoint Designer Causes "Sorry, this site hasn't been shared with you" Message

    Question

  • This problem came about when a user put in a ticket for an item on the left nav menu being highlighted in blue.

    (I was going to post image here, but my account isn't verified)

    I was able to find the offending code in the default.aspx file for the subsite (the main site collection is fine) and delete the bgcolor portion.  This seemed to work, but as I was logged in with an admin account, I didn't realize that for all other, non Full Control, users, going to the site displayed "Sorry, this site hasn't been shared with you."  I was able to revert to a saved copy of the default.aspx, but now we're back to square one with the one cell of a table being highlighted in dark blue.  During my subsequent troubleshooting (in a test environment, so I'm not worried about what I screw up), I noted that it didn't matter what I changed in the file, as soon as even a single character changed and the file was saved, it broke permssions.  Other pages on the site work fine, just not default.aspx.  For instance, I can go to http://url/subsite/_layouts/15/viewlsts.aspx, and that comes up fine, it's only http://url/subsite/default.aspx that gives the error.

    Anyone ever run across anything like this?  Several hours of Google searches have been no help.  I'm relatively new to SharePoint administration, and completely self-taught, so I'm aware that I'm probably not going about this in the best way.

    Thanks!

    Friday, April 07, 2017 7:02 PM

Answers

  • I got it fixed without breaking the permissions. I copied the default.aspx from the root of the site to SitePages via SharePoint Designer. I then edited the copy in SitePages with SharePoint Designer and took out the bgcolor tag in that one spot. I verified that I was able to get to the SitePages/default.aspx with my non-elevated account, and that the dark blue background was gone. Then, I copied the corrected file back to the site root with SharePoint Designer, and everything worked properly.
    • Marked as answer by KNelsonFA Wednesday, April 19, 2017 2:27 PM
    Wednesday, April 19, 2017 2:27 PM

All replies

  • Can you please check the below

    http://sharepoint.stackexchange.com/questions/110417/sorry-this-site-hasnt-been-shared-with-you-when-trying-to-access-mysite


    Please remember to click Mark as Answer on the answer if it helps you

    Friday, April 07, 2017 9:20 PM
  • I did what that link suggested, and no change.
    Monday, April 10, 2017 12:06 PM
  • Hi KNelsonFA, 

    I have done a test in my SharePoint 2013 and i cannot reproduce your issue. 

    I need to collect the following information to further troubleshoot the issue:

    Whether all other users got access denied error except users with full control permissions.

    Whether all other users got access denied error just on the default.aspx page or entire site. 

    Have you added some custom code on the default.aspx page?

    Since you cannot upload image, you can upload your image in OneDrive and share the link to us.

    Besides, Check the ULS log  to determine the exact cause of the error. ULS log is at:       

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS

    Best Regards, 

    Lisa Chen 


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, April 11, 2017 9:00 AM
    Moderator
  • All users that do not have Full Control permissions get access denied, and they only get it on default.aspx.  There is custom code that was added, but it was added some time ago, and not by me.  I have done reset site definition to restore the default.aspx without customization, but then whenever I edit that file in SharePoint Designer, the same problem comes up.  I will work on uploading the image to OneDrive, and I've been going through the ULS logs with no luck.  I'll keep digging.

    Tuesday, April 11, 2017 8:01 PM
  • Hi KNelsonFA,

    It seems that the custom code results to the problem.

    When you reset a customized page to the site definition, you discard all changes to that page and revert it to how it was originally defined in the site definition. But note that you don't lose any customizations that you have made to Web Parts, as long as those Web Parts reside in a Web Part zone that exists on the site definition page.

    So I suggest you deleting custom code from the default.aspx directly and compare the results.

    Best Regards,

    Lisa Chen


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, April 17, 2017 2:18 AM
    Moderator
  • The same problem persists if I delete the custom code.  ANY changes to the default.aspx file result in only those with Full Control being able to view the page.
    Tuesday, April 18, 2017 12:58 PM
  • From the ULS logs:

    Access denied.

    SPRequest.GetFileAndFolderProperties: UserPrincipalName=i:0).w|s-1-5-21-1335564976-1893161414-1846952604-258528, AppPrincipalName= ,bstrUrl=http://SERVER/SUBSITE ,bstrStartUrl=default.aspx ,ListDocsFlags=16400 ,bThrowException=False

    System.UnauthorizedAccessException: Access denied., StackTrace:   
     at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)    
     at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean throwException)    
     at Microsoft.SharePoint.SPFile.get_Exists()    
     at Microsoft.SharePoint.ServerWebApplication.Microsoft.Web.Design.Server.IServerWebApplication.GetProjectItemFromUrl(String url)    
     at Microsoft.Web.Design.Server.ServerWebApplication.Microsoft.Web.Design.Interop.IFPACWebApplication.GetProjectItemFromUrl(String pszUrl)    
     at Microsoft.Web.Design.DocumentDesigner.Microsoft.Web.Design.Interop.IWebDocumentDesigner.Initialize(IWebDocument document, IOleServiceProvider nativeServiceProvider, IWebRegisterDirectiveManager registerDirectiveManager)    
     at Microsoft.Web.Design.Server.ServerDocument..ctor(String documentUrl, String webUrl, String contextUrl, IServerWebApplication webApplication)    
     at Microsoft.SharePoint.PageParser.CreateAndInitializeDocumentDesigner(String pageUrl, SPWeb web, String contextUrl, List`1 registerDirectiveDataList, MarkupOption markupOption, IServerWebApplication webApplication)    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CompressUsingMicrosoftWebDesigner(SourceContent sourceContent, String allRegisterDirectives)    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CompressInOrder(Deserializer firstMethod, Deserializer secondMethod, SourceContent sourceContent, String allRegisterDirectives, Boolean isClosed)    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CompressWebPartNoSave(Boolean isClosed)    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.LoadWebParts()    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e)    
     at System.EventHandler.Invoke(Object sender, EventArgs e)    
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
     at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
     at System.Web.UI.Page.ProcessRequest()    
     at System.Web.UI.Page.ProcessRequest(HttpContext context)    
     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)    
     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)    
     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)    
     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)    
     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)    
     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)    
     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)  

    Access Denied. Exception: Access denied., StackTrace:  
     at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAndFolderProperties(String bstrUrl, String bstrStartUrl, ListDocsFlags ListDocsFlags, Boolean bThrowException, Int32& phrStatus, Object& pvarFiles, Object& pvarDirs, UInt32& pdwNumberOfFiles, UInt32& pdwNumberOfDirs)    
     at Microsoft.SharePoint.Library.SPRequest.GetFileAndFolderProperties(String bstrUrl, String bstrStartUrl, ListDocsFlags ListDocsFlags, Boolean bThrowException, Int32& phrStatus, Object& pvarFiles, Object& pvarDirs, UInt32& pdwNumberOfFiles, UInt32& pdwNumberOfDirs).

    Getting Error Message for Exception System.Threading.ThreadAbortException: Thread was being aborted.    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CompressWebPartNoSave(Boolean isClosed)    
     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)


    Tuesday, April 18, 2017 3:20 PM
  • I got it fixed without breaking the permissions. I copied the default.aspx from the root of the site to SitePages via SharePoint Designer. I then edited the copy in SitePages with SharePoint Designer and took out the bgcolor tag in that one spot. I verified that I was able to get to the SitePages/default.aspx with my non-elevated account, and that the dark blue background was gone. Then, I copied the corrected file back to the site root with SharePoint Designer, and everything worked properly.
    • Marked as answer by KNelsonFA Wednesday, April 19, 2017 2:27 PM
    Wednesday, April 19, 2017 2:27 PM