0

I’m looking for an example or best practices for a RBAC system with two parameters. Rather than simply having a user associated with a role, and that role associated with a group of permissions; a user can be associated with a role “for a specific project,” and the user can then have the permissions of that role for that project only (or for other projects that the user holds that role for). A user can have a specific role on one project, and a different role on another project; the permissions granted to a role are consistent for every project; and a user’s permissions for a project are based on what role that user has on the project.

(If it makes any difference, I’m trying to limit page access where the page content is developed via a URL query parameter that sets the project id through a GET statement.)

ABAC looks promising, but I’m having trouble wrapping my head around it. My understanding is that a user’s attribute dictates whether the user has the role (and/or permissions). In my case it seems like I might consider the project to be the “user,” and my user as an attribute of the project (true, if my user holds the role for that project or false, if not)

4

1 回答 1

1

如果你想坚持 RBAC 标准,那么你将不得不为不同的项目使用不同的角色。例如,如果在项目“P1”和“P2”中使用角色“admin”,您可以创建一个角色“P1:admin”和另一个角色“P2:admin”。

ABAC确实是另一种可能。但是,如果我对您的理解正确,那么说“用户的属性决定用户是否具有角色(和/或权限)”是不正确的。ABAC 中只有属性(在角色属性的意义上),它提供了比 RBAC 更大的灵活性。在请求中,您可以有一个代表项目的属性(“P1”或“P2”),以及另一个代表该特定项目角色的属性(“admin”)。例如,正确指定的策略将能够识别您将“admin”角色作为“P1”项目的一部分。

于 2014-01-14T11:58:50.997 回答