1

我们将网站的不同区域锁定为特定用户。例如,作为站点核心角色“UK_Editor”成员的用户可以查看所有其他国家/地区的内容(他们只有读取权限)。但是,在英国地区,他们可以完全访问。

问题是,用户仍然可以转到其他国家/地区的内容,并且“发布”按钮仍然可用。

有没有办法限制这个?

Sitecore v:6.5.0

4

3 回答 3

6

您可以测试启用 Publishing.CheckSecurity 配置设置,应该会阻止用户发布应用了正确角色的其他站点内容。

       <!--  PUBLISHING SECURITY
        Check security rights when publishing?
        When CheckSecurity=true, Read rights are required for all source items. When it is
        determined that an item should be updated or created in the target database,
        Write right is required on the source item. If it is determined that the item
        should be deleted from target database, Delete right is required on the target item.
        In summary, only the Read, Write and Delete rights are used. All other rights are ignored.
        Default value: false
  -->
        <setting name="Publishing.CheckSecurity" value="true" />
于 2013-03-25T10:03:53.873 回答
3

您也许可以覆盖QueryState类的PublishItem(在Sitecore.Shell.Framework.Commands

阅读此问题以获取更多信息。如果要隐藏按钮,则
需要返回。CommandState.Hidden你需要想出一些聪明的办法来确保他们都可以用他们的语言发布内容,但不能用其他人的语言发布。

[编辑]
可能会执行类似的操作,if (Sitecore.Context.User.IsInRole('sitecore\englisheditor') && context.Items[0].Language == Sitecore.Data.Managers.GetLanguage('en')) {return base.QueryState(context)}
否则您可以返回 CommandState.Hidden。不过,我并不完全确定 if 语句的第二部分。

于 2013-03-25T09:47:11.040 回答
1

看看下面的博客文章,它描述了如何安全控制与在核心数据库中发布相关的 UI 项。

http://www.cognifide.com/blogs/sitecore/why-and-how-hide-publish-site-buttons-in-sitecore/

于 2013-03-26T07:43:55.123 回答