Plone 中的多级安全性?

发布于 2024-10-21 10:19:48 字数 202 浏览 0 评论 0原文

有什么办法可以完成以下任务吗?

我希望 Plone 中的每个对象都与一个以上的安全分类相关联(例如“alpha”、“bravo”、“zulu”)。这些分类将是内容类型架构的一部分。在运行时,用户的安全凭证将与该对象进行比较,并且当且仅当用户拥有该对象的所有凭证时该对象才可见。我在工作流程中看不到任何执行此操作的方法。

接受建议。谢谢!

斯坦

is there any way to accomplish the following?

I would like for each object in Plone would be associated with one more security classifications (e.g. 'alpha', 'bravo', 'zulu'). These classifications would be part of the content type's schema. At runtime, the user's security credentials would be compared against the object, and if and only if the user had all the credentials of the object would the object be viewable. I can't see any way of doing this in workflow.

Open to suggestions. Thanks!

Stan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦情居士 2024-10-28 10:19:48

您需要一个 localrole 适配器,它可以检查用户的凭据(假设您已经有一个可以为他们提供此类凭据,因为 - 超出角色的基本概念 - 它们在基础 Plone 中不存在),并根据结果。

请参阅:http://plone.org/products/plone/roadmap/208

它可能就像提供 __ac_local_roles() 方法一样简单,但如果没有,borg.localrole 现在是 Plone 的一部分,该链接应该可以帮助您开始。

You need a localrole adapter that can examine the user's credentials (presumably you already have some one to give them such credentials, as - beyond the basic concept of roles - they don't exist in base Plone), and grant a local_role based on the result.

See: http://plone.org/products/plone/roadmap/208.

It might be as simple as providing an __ac_local_roles() method, but if not, borg.localrole is now part of Plone and that link should get you started.

尴尬癌患者 2024-10-28 10:19:48

请记住,CMFWorkflow 允许一个对象具有多个与其关联的工作流。您可以将方案的各个级别实现为单独的工作流程,然后将它们附加到您的对象。

Bear in mind that CMFWorkflow allows for an object to have more than one workflow associated with it. It might be possible for you to implement the various levels of your scheme as individual workflows and then attach them to your objects.

木森分化 2024-10-28 10:19:48

您还可以通过以下方式使用工作流程来完成此操作。请注意,我并不是说您应该使用工作流程来完成此操作,只是说您可以;)
您将需要(大量)状态。大小取决于安全状态的组合(!=排列)。从n个事物中选择m个事物的组合由下式给出:

n!/(m!(n-m)!),

其中!是阶乘。

例如,对于您给出的示例,您有 3 个安全状态 alpha、bravo 和 zulu。得出:

3!/(1!2!) + 3!/(2!1!) + 3!/(3!0!) = 3 + 3 + 1 = 7

总和是其中 1、2 或 3 个的组合。
所以你就知道了,总共有七个状态;)

过渡是一个不同的野兽。如果您确实需要能够从任何这些组合状态转到任何其他状态,那么您将必须计算排列,因为从 a 到 b 与从 b 到 a 不同。排列由下式给出:

n!/(n-m)!

即对于上面的 7 个状态,您将有 7!/(7-2)!=7*6=42 (!!!) 个转换。当然,您可以通过每次仅允许添加/删除一种安全状态来简化转换。
好了,我希望你读这篇文章时和我写它时一样有趣:)

Here is also how you could do it with workflow. Note I am not saying you should do it with workflow, just that you can ;)
You would need a (large) number of states. How large depends on the combinations (!=permutations) of your security states. The combinations of choosing m things among n things is given by:

n!/(m!(n-m)!),

where ! is the factorial.

For instance for the example you give you have 3 security states alpha, bravo and zulu. This gives:

3!/(1!2!) + 3!/(2!1!) + 3!/(3!0!) = 3 + 3 + 1 = 7

The sum is the combinations of having 1, 2, or 3 of them together.
So there you go, seven states all in all;)

The transitions are a different beast. If you do need to be able to go from any of these combined states to any other then you would have to calculate permutations as going from a to b is different to going from b to a. Permutations are given by:

n!/(n-m)!

i.e. for the 7 states above you would have 7!/(7-2)!=7*6=42 (!!!) transitions. You could of course simplify the transitions by only allowing adding/removing one security state each time.
There you go, I hope you have as much fun reading this as I had writing it :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文