最佳基于角色的访问控制 (RBAC) 数据库模型 [英] Best Role-Based Access Control (RBAC) database model

查看:30
本文介绍了最佳基于角色的访问控制 (RBAC) 数据库模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

跟踪 Web 应用程序基于角色的访问控制的最佳数据库架构是什么?

What is the best database schema to track role-based access controls for a web application?

我正在使用 Rails,但 Google 链接的 RBAC 插件看起来没有维护(只有 300 次提交到 SVN;最新的几乎是一年前).

I am using Rails, but the RBAC plugin linked by Google looks unmaintained (only 300 commits to SVN; latest was almost a year ago).

这个概念很简单,可以从头开始实施,但又很复杂,很重要,值得一试.

The concept is simple enough to implement from scratch, yet complex and important enough that it's worth getting right.

那么其他人如何构建和实现他们的 RBAC 模型?

So how do others architect and implement their RBAC model?

推荐答案

就我在该领域的基本知识而言,RBAC 的基本角色是:

To my rather basic knowledge in that area, the basic actors of an RBAC are:

  • 资源.
  • 权限.
  • 用户.
  • 角色(即群组).

资源 <- 要求->(一个或多个)权限.

角色 <- 是->(一个或多个)权限的集合.

用户 <- 可以拥有 ->(一个或多个)角色.

这种模型的表格是:

  • 权限
  • 角色
  • 用户
  • role_permission
  • 用户角色

现在,如果您希望应用程序的用户能够配置资源需要哪些权限,您可能还希望在此处包含资源.但我从来不需要那个.希望有所帮助.

Now you might want to include resources here as well if you want users of your application to be able to configure which permissions a resource need. But I never needed that. Hope that helps.

这篇关于最佳基于角色的访问控制 (RBAC) 数据库模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆