仅允许 Sitecore 用户在 Workflow 中查看自己的项目
有没有一种方法可以让用户看到工作流程,但只允许他们看到工作流程中自己的项目?
这似乎是一个很常见的问题。您拥有大量内容创建者,您只希望他们看到自己的内容在工作流程中的进展情况,而不是其他人创建的内容。
可能的(近似且混乱的)解决方案: 我能想到的唯一可能性是关闭权限继承,以便我可以明确拒绝工作流的查看权限。然后,通过工作流程中的自定义操作,我可以显式打开用户提交的每个项目的查看权限。
我走在正确的轨道上吗?我希望不会。 ;)
问题澄清: 我希望审批者能够看到所有内容,但我希望作者打开工作流程并且只能看到自己的项目,而不是其他作者的数十个项目。
Is there a way to allow users to see workflow, but only allow them to see their own items within the workflow?
This seems like a problem that would be common. You have a large number of content creators and you only would want them to see how their content is moving in workflow, not the content created by others.
Possible (approximate and messy) solution:
The only possibility I could think of would be to turn off rights inheritance so that I could explicitly deny viewing rights to workflow. Then with a custom action in workflow I could explicitly turn on view rights to each item a user submits.
Am I on the right track? I hope not. ;)
Question Clarification:
I want approvers to see everything, but I want authors to open workflow and only see their own items, not dozens of items from other authors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是默认行为,因为工作流的常见用途是用于审批流程。在这种情况下,审批团队将登录并查看等待创作团队审批的项目,如果他们只能看到他们创建的项目,那么他们根本看不到任何内容。
我能想到的一种方法是覆盖工作箱应用程序旁边的代码。查看此文件 Website\sitecore\shell\Applications\Workbox\Workbox.xml 及其类 Sitecore.Shell.Applications.Workbox.WorkboxForm 旁边的代码。如果您将自己的类放在这里,您可能可以将所需的所有逻辑添加到“GetItems”方法中。
This is not the default behaviour as the common use of workflow is for an approval process. In that case the approval team would log in and see the items waiting for approval from the authoring team, if they could only see the items they created then they wouldn't see anything at all.
One way I can think of doing this would be to override the codebeside for the workbox application. Take a look at this file Website\sitecore\shell\Applications\Workbox\Workbox.xml and it's codebeside class Sitecore.Shell.Applications.Workbox.WorkboxForm. If you put your own class in here you could probably add all the logic you need to the 'GetItems' method.
从另一个角度攻击这个问题,考虑到您希望作者了解他们的项目是否已获得批准,而不是让他们访问工作箱,为什么不向批准状态(或批准命令)添加自定义电子邮件操作,以便当他们的项目获得批准时,作者会收到一封电子邮件。您还可以自定义电子邮件,使其包含已批准项目的链接或包含项目的详细信息,以便作者在创作了多个项目时可以识别单个项目。
Sitecore.Kernel 程序集中的 Sitecore.Workflows.Simple.EmailAction 类中有一个示例电子邮件操作,您可以将其用作自定义的基础。
如果您想确保所有项目在特定时间范围内获得批准,您还可以使用ASR 共享源模块< /a> 生成有关在特定时间范围内尚未批准的项目的报告,并定期自动通过电子邮件发送此报告。
Attacking this from another angle, given you want visibility to the authors on if their items have been approved or not, instead of giving them access to the workbox, why not add a customised email action to the approved status (or the approve command) so that the authors receive an email when their item has been approved. You could also customise the email so that it includes a link to the approved item or includes details of the item so that the author can identify the individual item if they have authored multiple items.
There is a sample email action in the Sitecore.Workflows.Simple.EmailAction class in the Sitecore.Kernel assembly that you can use as a base to your customisations.
If you want to make sure that all items are being approved within a certain timeframe, you could also use the ASR shared source module to generate reports on items that have not been approved within a certain timeframe and have it automatically email this report on a regular basis.