简体   繁体   中英

Role Based Access Control MySql Implementation

I'm about to develop a management web app with Laravel.

I need that my users have different roles with different permission.

In details: some users can add customers, some users can write pieces of a paper related to the customer, some other users can just read that paper and some other users can read just some pieces of that paper.

So I decided to use an RBAC approach in order to gain a certain flexibility. I'll use this DB schema (just an example schema, but represent the needings of my application):

dbexample

My answer is: since there is a direct relationship between users and paper, customer, attachs etc., how are RBAC rules expressed? I have to check user's permission in frontend when he request an operation or a resource? Or there are ways to express this rules even at backend level? Maybe using some GRANT options?

Hope sby can help. Thank you!

I would recommend using one of the RBAC packages already available to you, there are a few out there but a couple noteworthy mentions include:

You define roles such as User and Customer , permissions such as can-write-paper , can-read-paper and assign them to either roles or individual users depending on your use case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM