내가 아는 한, 네이티브 Sitecore 보안 모델은 이와 관련하여 결함이 있습니다. 언어 읽기/쓰기 액세스는 콘텐츠 트리의 특정 부분에 현지화 될 수 없습니다. 즉, 언어를 편집 할 수있는 경우 쓰기 권한이있는 모든 컨텐트 항목에서 언어를 편집 할 수 있습니다.
그러나 saveUi 파이프 라인과 getContentEditorWarnings 파이프 라인을 조합하여 요구 사항을 충족시킬 수 있다고 생각합니다.
당신이 사용자가 현재 언어의 지정된 내용을 편집 할 수 있어야 여부를 확인하는 프로세서가 필요합니다이 파이프 라인에서 saveUi
. 어떻게 구성되고 결정되는지 (XML 구성? 콘텐츠 트리의 한 지점에있는 언어 별 항목에 대한 사용자 액세스) 사용자에게 맡기 겠지만 사용자가 액세스를 거부해야하는 경우 구하다.
public class CheckLanguageWritePermission
{
public string WorkflowStateID { get; set; }
public void Process(SaveArgs args)
{
Assert.ArgumentNotNull(args, "args");
Assert.IsNotNull(args.Items, "args.Items");
foreach (SaveArgs.SaveItem item in args.Items)
{
Item item2 = Sitecore.Client.ContentDatabase.Items[item.ID, item.Language];
if (/* user should not have permission*/)
{
AbortSave(args);
return;
}
}
}
protected void AbortSave(SaveArgs args)
{
if (args.HasSheerUI)
{
SheerResponse.Alert("You do not have permission to edit this item in the current language.");
SheerResponse.SetReturnValue("failed");
}
args.AbortPipeline();
}
}
getContentEditorWarnings
실제로이 방법 (그냥 저장)와 컨텐츠를 편집에서 사용자를 방지 할 수 있기 때문에, 당신은 아마 많은라는 경고를 제공해야합니다.
public class CheckLanguageWritePermission
{
// Methods
public void Process(GetContentEditorWarningsArgs args)
{
Item item = args.Item;
if (/* user should not have permission*/)
{
GetContentEditorWarningsArgs.ContentEditorWarning warning = args.Add();
warning.Title = "You do not have permission to edit this item in the current language.";
warning.IsExclusive = true;
}
}
}
완벽한 솔루션은 아니지만 바람직하지 않은 콘텐츠 수정을 방지합니다. 버전 관리/워크 플로가 작동중인 경우 addversion 및 item : checkout 항목에 대한 UI 명령을 재정 의하여 새로운 버전을 추가하지 못하도록 할 수 있습니다.
액세스 권한을 결정하는 것이 까다로울 수 있으므로 최선의 방법은 특정 비즈니스 규칙에 따라 달라질 수 있습니다.