3

Is there any way to restrict a sitecore user to edit only final layout? they still should be able to view the shared layout.

I tried doing below changes through role manager.

  • switched to core db
  • opened role manager and selected a custom role
  • opened security editor
  • navigated to /sitecore/content/Applications/WebEdit/Ribbons/Chunks/Layout Modes/
  • Did changes as per below pic.

enter image description here

Still i see the users assigned to that role has access to edit shared layout. Any suggestions on what i am missing?

Also, the custom role above is member of sitecore/designer and sitecore/author role.

  • I would also try to restrict the rights for the Shared Layout field in master database for the Standard Template. Becausr what you did is only the restriction for the buttons on the ribbon. – Tamás Tárnok Nov 8 '16 at 7:30
  • @TRNKTMS that would be my next step :) .. at present i am seeing the buttons as well as able to perform edits. – Pankaj Prasad Nov 8 '16 at 7:45
  • Have you solved this issue? I need to hide "Shared Layout" tab from "Presentation Details" so I've spent the whole day investigating it, but without any success. – Artur Yakimovich Mar 1 '17 at 14:24
2

Updated Response

After looking into more details, your issue can be addressed by updating the RenderingLayoutGridBuilder method located inside Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm

  1. Create a copy of LayoutDetailsForm.cs class in your local assembly.
  2. Add logic to the method RenderLayoutGridBuilder in such a way that EditRenderingClick and OpenDeviceClick are set to string.Empty for users in a specific role.
  3. You also need to make sure the layoutValue is for shared layout renderings.
private void RenderLayoutGridBuilder(string layoutValue, Control renderingContainer)
{
    string str = renderingContainer.ID + "LayoutGrid";
    LayoutGridBuilder builder = new LayoutGridBuilder {
        ID = str,
        Value = layoutValue,
        EditRenderingClick = "EditRendering(\"$Device\", \"$Index\")", 
        EditPlaceholderClick = "EditPlaceholder(\"$Device\", \"$UniqueID\")",
        OpenDeviceClick = "OpenDevice(\"$Device\")",
        CopyToClick = "CopyDevice(\"$Device\")"
    };
    renderingContainer.Controls.Clear();
    builder.BuildGrid(renderingContainer);
    if (Context.ClientPage.IsEvent)
    {
        SheerResponse.SetOuterHtml(renderingContainer.ID, renderingContainer);
        SheerResponse.Eval("if (!scForm.browser.isIE) { scForm.browser.initializeFixsizeElements(); }");
    }
}

No option to edit or open renderings

  • I want to show them the shared layout rendering list.They should not be able to perform Edits like add/remove components/renderings. – Pankaj Prasad Nov 9 '16 at 6:00
  • Other than author and designer they have client publishing access. – Pankaj Prasad Nov 9 '16 at 6:00
  • Let me see if I can find another solution to address this. I will keep you posted. – Srikanth Kondapally Nov 10 '16 at 15:55
  • I have updated my response. Hope this helps – Srikanth Kondapally Nov 14 '16 at 16:14
2

Show Field Read Field Write columns in security editor, navigate to /sitecore/templates/System/Templates/Sections/Layout/Layout/__Renderings item and deny field write.

enter image description here

  • I have done the changes as you mentioned but still i am able to perform edit from shared layout. – Pankaj Prasad Nov 8 '16 at 9:38
2

One solution to achieve the desired functionality you can override the Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm class.

Here is an example of how to do this:

  1. Create an assembly with the class that has the same code as defined in the LayoutDetailsForm class.

  2. Add the following code to the end of the OnLoad method:

       if (Sitecore.Context.User.IsInRole("yourrole"))
       {
          LayoutPanel.Visible = false;
       }
    
  3. Build the assembly and add it to the \bin folder.

  4. Open the \Website\sitecore\shell\Applications\Content Manager\Dialogs\LayoutDetails\LayoutDetails.xml file and replace the following line:

<CodeBeside Type="Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm,Sitecore.Client" />

With this line:

<CodeBeside Type="MyNamespace.LayoutDetailsForm,MyAssembly" />

After performing these changes the content of the Shared Layout tab will be hidden depending on user role.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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