我有三个表,角色,权限和角色权限
Table Roles has the following: id, role_name
Data: id, role_name
1, Accounting
2, Order_Entry
3, Shipping
Table Permission has: id, permission _name
Data: id, permission _name
1, Admin
2, Super_User
3, Read_Write
4, Read_Only
Table Role_ Permissions has:
role_id (FK from Roles),
permission_id (FK from Permissions)
我需要创建一个如下所示的矩阵:
Heading: Roles Admin Super_User Read_Write Read_Only
Columns/Rows: Accounting X X
Order_Entry X X
Shipping X X
'X'表示该角色有权限。当然,空白意味着没有该角色的许可 可以在SQL
中完成