设计一个复杂的访问/权限系统,我应该采取什么方法

发布于 2024-11-27 05:06:53 字数 527 浏览 1 评论 0原文

我现在使用 PHP+MySQL,但实际上可以采用任何工具。

我有一个大约有 50000 个用户的系统,这些用户被排列成组,排列成部门,排列成组织。

我的系统内容包中有。每个包都有特定的权限。即每个包要么是

  1. 公共的(世界),
  2. 要么是联盟的(全部注册到我的系统)
  3. 私有的(可以由单个用户+组+部门+组织的任意组合访问)

为了让事情变得更困难,每个内容可能都有一个先决内容,意味着您在学习内容 A 之前不能学习内容 B(大学课程...)。

我想知道如何管理它,现在一切都在 MySQL 中并且工作正常,只是每次我创建具有先决条件的内容时,我必须能够仅选择那些具有更宽松访问权限的内容片段作为先决条件,这意味着系统中的每个部分都需要进行大量计算(我有几千个)。

现在,假设我有内容 c,它依赖于 B,而 B 又依赖于 A...
我向每个用户展示的目录是什么?想象一下当用户搜索整个系统时我必须对每个内容片段进行的计算。

有任何方向/建议/已知系统已经做到了这一点吗?

I am using PHP+MySQL right now, but really can adopt any tool out there.

I have a system with about 50000 users which are arranged into groups, which are arranged into departments which are arranged into organizations.

I have in my system content packages. Each package has a specific permission. i.e. each package is either

  1. public (world),
  2. consortium (all registered to my system)
  3. private (can be accessed by any combinations of single users + group + department + organization)

To make things harder, Each content might have a pre-requisite content, means you can't take content B before you took content A (courses in a university...).

I am wondering how to manage it, right now every thing is in MySQL and works fine, just that each time I create a content with pre-requisite I must be able to choose as pre-requisite only those content pieces with more permissive access, which means a lot of computations for each piece I have in the system (I have a few thousands).

Now, Imagine I have content c which depends on B which depends on A...
And what is the catalog that I show to each user? Imaging the calculation I have to do for each content piece when the user searches the entire system.

Any direction/suggestion/known systems that do that already?

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

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

发布评论

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

评论(1

独留℉清风醉 2024-12-04 05:06:53

我意识到这个问题已经持续了两年多了,现在您可能已经解决了您的问题。不过,这里有一些提示可以帮助您解决所面临的问题。

您需要外部化您的授权逻辑和业务逻辑。这意味着您想要研究业务规则引擎和授权规则引擎。

该领域的标准是 BPEL(针对业务流程)和 XACML(针对授权)。

您可以使用 XACML 来确定谁可以查看/编辑/获取某些内容。您可以使用 BPEL(或 BPM 语言)来确定参加一门课程的规则,然后才能参加另一门课程。

I realize this question is over 2 years and that by now you have likely solved your issue. Still, here are some pointers to help solve the problem you were faced with.

You need to externalize your authorization logic and your business logic. This means you want to look into business rules engines and authorization rules engines.

The standards in that space are BPEL (for business processes) and XACML (for authorization).

You'd use XACML to determine who can view / edit / take certain content. You'd use BPEL (or BPM languages) to determine the rules about taking a course before you can take another.

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