In addition to what you have done you can do the following using a role:
In the master database deny field read and write access to /sitecore/templates/System/Templates/Sections/Layout/Layout/__Renderings
. This will keep the user from being able to manually edit the shared field. This is not necessary is you already deny access to view standard fields in any way.
After doing that you will need to go to the file webroot/sitecore/shell/Applications/Content Manager/Dialogs/LayoutDetails/LayoutDetails.xml
and change the CodeBeside
to point to a custom class that inherits from Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm
. Here is an something you could use:
using Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails;
using System;
namespace MyProject.Common
{
public class CustomLayoutDetailsForm : LayoutDetailsForm
{
private const string DenySharedLayoutViewRole = "{YOUR_ROLE}";
protected override void OnLoad(EventArgs e)
{
if (Sitecore.Context.User.IsInRole(DenySharedLayoutViewRole))
{
SharedLayoutTab.Active = false;
FinalLayoutTab.Active = true;
Tabs.Active = (int)TabType.Final;
SharedLayoutTab.Visible = false;
}
base.OnLoad(e);
}
//Had to add this because the base TabType enum the base
//type uses is private. You can just use a number if you
//really wanted to where I use this if you are worried
//someone will see that Shared/Unknown aren't used and
//remove them
private enum TabType
{
Shared,
Final,
Unknown,
}
}
}
You would copy in your role with its domain where I put {YOUR_ROLE}
. You could put the role in a config file. If you need multiple roles to do this make a base role to deny access to the shared layout and have those inherit that.