Better way to add extra attributes in RBAC (Role Based Access Control) tables?

断了今生、忘了曾经 提交于 2020-01-16 08:33:33

问题


I have implemented RBAC (Role Based Access Control) tables. I have a requirement to add extra attribute on some roles, like 2nd_pwd attribute in Admin role, address attribute in Customer role.

I have done this design, but it violates data integrity. When you removed (let's say) Admin role, you also need to remove admin data from Admin table. So I decided to add trigger for this job.

Question:

  1. Is there a design for this requirement without trigger but still doesn't violate data integrity?
  2. What is the common implementation for this requirement? Is it normalized enough?

来源:https://stackoverflow.com/questions/44644449/better-way-to-add-extra-attributes-in-rbac-role-based-access-control-tables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!