November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Thanks for the feedback. Are you looking to have a separation between people who can change the contents of a page, and people who can modify the structure of a site? In other words, do you also see a need to have people that can modify all language content, but never move pages around?
Hi Martin. There is a possibility to do that by disabling "Delete" access to such editors, so they would be able to edit content, but not changing the structure or delete pages. But our usual case is each country has its own editor who manages all content and structure for one language. And the problem that these editors still can occasionally change structure or delete pages in other languages.
Currently I'm using page "Moving" event handler to restrict access, but I think logically this should work out-of-box:
var contentEvents = ServiceLocator.Current.GetInstance<IContentEvents>(); contentEvents.MovingContent += Events_MovingContent; private void Events_MovingContent(object sender, ContentEventArgs e) { if (!(e.Content is PageData)) { return; } var languages = ServiceLocator.Current.GetInstance<ILanguageBranchRepository>(); var versions = ServiceLocator.Current.GetInstance<IContentVersionRepository>(); var pageVersions = versions.ListPublished(e.Content.ContentLink); var pageLanguages = languages.ListEnabled() .Where(lb => pageVersions.Any(v => v.LanguageBranch == lb.LanguageID)) .ToList(); if (pageLanguages.Any(lang => !lang.ACL.QueryDistinctAccess(AccessLevel.Edit))) { var action = e.TargetLink == ContentReference.WasteBasket ? "remove" : "move"; e.CancelAction = true; e.CancelReason = $"You can't {action} the page, because it contains other language versions you don't have access to."; } }
Thanks for sharing that snippet. So if I understand correctly, you have a single content tree shared by multiple country sites, where every country manages their own variation of the structure. Re-using some of the shared structure, and in places overriding with their own structure?
Yep, exactly. We have a master site in English with general structure and country editors translate existing main pages, but countries also have unique pages and sections.
That makes sense, and it's a pattern I see used often so would like to support it better. Nothing on the official roadmap yet though.
There is a possibility to restrict editors create/edit access to one or more specific languages in Episerver. But move/delete actions can't be restricted, so editors still can move/delete entire page including all descendants if they have create/edit access to any language version of a page.
This is a usual demand from our customers with multi-language websites with a shared page tree, which is a powerful Episerver use case comparing to other CMS like Umbraco. If an editor doesn't have access to other language versions of a page, he shouldn't be able to move/delete the page, because he is not authorized to change content/structure in other languages.