Unlocking Layout Switching for Sitecore SXA Site Authors
When working with Sitecore SXA, managing user roles and permissions is essential to ensure smooth content creation and site administration. However, sometimes the default out-of-the-box (OOTB) roles don't fully support the complex tasks content authors need to perform. One such challenge I encountered involved the Site Author role and its inability to switch between Shared and Final layouts in Experience Editor. Layout switching is critical for personalizing content and managing variations for different audiences, but this functionality was blocked for Site Authors by default.
In this blog, I'll walk through how I identified and resolved this issue by adjusting permissions in Sitecore’s Core database, enabling Site Authors to access both layouts.
The Problem: Layout Switching Blocked in Experience Editor
For context, we had set up security for the Tenant and Site across all instances. The issue arose with the out-of-the-box (OOTB) Site Author role. Client authors with this role couldn't switch between shared and final layouts when editing content in the Experience Editor. These layouts are crucial for personalizing content and creating variations for different audiences, making access to both essential for content authors.
So when an author in experience editor would neither have access to view the layout in which they are at currently and switch them as in the below screenshot.
As per the Sitecore documentation, these are the OOTB Sitecore Roles and their rights when managing sites.
Ideally, the Site Author role is responsible for managing content in the website and it is essential that this role is granted access to the content, media, data and presentation areas as per the documentation. After a short research on this, I came across this blog in the Sitecore community which discusses this issue and has a few workarounds. Out of which editing permission in the core database solved my issue.
The Core Database Fix
The Core database serves a unique role in managing the user interface, configuration, and application settings for Sitecore. For this particular issue, the current layout command is missing in the layout chunk of the presentation tab as in the screenshot below.
Specifically, the "Edit All Layouts" permission needed to be granted for the Site Author role in the Core database. Without this permission, users couldn’t access the feature that allows visibility of the current layout or switch between Shared and Final layouts.
By manually providing read access to "Edit All Layouts" in the Core database made the current layout command visible to Site Authors thereby switching the layouts.
While this functionality might seem like an inherent feature of the Site Author role, manual adjustments in the Core database had to be done to enable it. According to Sitecore documentation and the general rule that Site Authors should have access to presentation settings, this particular capability was somehow overlooked in the default configuration.
Ensuring the Site Author role can switch between Shared and Final layouts in Sitecore SXA required a simple but crucial permission adjustment in the Core database. By granting the "Edit All Layouts" permission, enabled content authors to access both layouts, allowing them to personalize content more effectively. Applying this solution across all environments ensures a consistent experience for content authors, keeping workflows smooth and efficient.