Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created feature that have a module that have a element file and a default aspx inside of it.

The element file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Pages2" Url="$Resources:cmscore,List_Pages_UrlName;" Path="Pages2">
    <File Url="NewsApproval.aspx" Type="GhostableInLibrary" Path="default.aspx" >
      <Property Name="Title" Value="News - Information"/>
      <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/InformationMessage.aspx, Text page" />
      <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />

      <AllUsersWebPart WebPartZoneID="left">
        <![CDATA[
        <?xml version="1.0" encoding="utf-8"?>
        <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">
          <Title>Information</Title>
          <FrameType>Default</FrameType>
          <Description> </Description>
          <IsIncluded>true</IsIncluded>
          <ZoneID>Right</ZoneID>
          <PartOrder>0</PartOrder>
          <FrameState>Normal</FrameState>
          <Height />
          <Width />
          <AllowRemove>true</AllowRemove>
          <AllowZoneChange>true</AllowZoneChange>
          <AllowMinimize>true</AllowMinimize>
          <AllowConnect>true</AllowConnect>
          <AllowEdit>true</AllowEdit>
          <AllowHide>true</AllowHide>
          <IsVisible>true</IsVisible>
          <DetailLink />
          <HelpLink />
          <HelpMode>Modeless</HelpMode>
          <Dir>Default</Dir>
          <PartImageSmall />
          <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
          <PartImageLarge>/_layouts/15/images/mscontl.gif</PartImageLarge>
          <IsIncludedFilter />
          <Assembly>Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
          <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
          <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
          <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor">Hello world!</Content>
          <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
        </WebPart>
        ]]>
      </AllUsersWebPart>     
    </File>   
  </Module>
</Elements>

and the default is just the standard one:

<%@ Page Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>

The pagelayout for it looks like this:

%@ Page language="C#"   Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
    <SharePointWebControls:ListItemProperty Property="Title" maxlength="40" runat="server"/>
</asp:Content>

<asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server">
    <SharePointWebControls:CssRegistration ID="StartPageLayoutCss" name="<% $SPUrl:~SiteCollection/_layouts/15/AA/portal/css/pagelayouts/PageLayouts.less%>" After="corev4.css" runat="server"/>
</asp:Content>

<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
    <div id="calendar-archive-main-zone" >

        <div class="calendar-archive-left-zone" id="info-zone">
            <%--Toggle month/day-view--%>
            <%--Add code for this, use querystring param: ?CalendarPeriod=day or ?CalendarPeriod=month--%>
            <%--  --%>
            <%--<div id="breads"><a id="calendar-breadcrumb" href="/"></a></div>--%>
            <WebPartPages:WebPartZone runat="server" Title="loc:Left" ID="Left" FrameType="TitleBarOnly" AllowLayoutChange ="False"  AllowPersonalization="False"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>

        </div>

        <div class="ms-clear"></div>
    </div>

     <script type="text/javascript">
         $(document).ready(function () {
             $('#site_follow_button').hide();
             setTimeout("location.href = '/';", 2500);
         });

        </script>

As a administrator I can access /pages/newsapproval.aspx but when I try to visit it as a publisher I get access denied, This site has not been shared with you.

Any kind of help is appreciated

share|improve this question
    
First, don't hang out your clients in code snippets, it's probably not liked by the customer. Secondly, try to check in the page or publish it, that should make it available to all users –  Robert Lindgren May 23 '13 at 18:03
    
If that does not help, try removing Webparts, could be one of them that throws the acces denied (if so, you need to look for the source be debugging the webpart code) –  Robert Lindgren May 23 '13 at 18:09
    
Thanks for the notice, I will check that out. –  Rohander May 23 '13 at 18:28
    
I tried re-publish, approve and check it in but its still not working, also tried with removing the webpart. :/ –  Rohander May 23 '13 at 18:44

1 Answer 1

If checking the page in does not work, check the ULS logs (Found in the 15-hive under LOGS) for errors when loading the page.

A, not so wild, guess would be that some resource that the page is using is not accessible to all users. This could for example be the Master page not being checked in, or some script calling a location where other users do not have access.

share|improve this answer
1  
I found the issue, the pagelayout was not published, but the page was, publishing the pagelayout did the trick! –  Rohander May 23 '13 at 19:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.