How to manage User Roles in a Database?

后端 未结 5 568
失恋的感觉
失恋的感觉 2020-12-22 22:25

I\'m creating a website in which I will be managing users and their permissions. I am looking to implement user roles, and can\'t seem to wrap my head around how things shou

5条回答
  •  离开以前
    2020-12-22 23:02

    If you want to go the route of the 3 tables, you could create your tables like so:

    Table       | Rows
    User        | id ; name ; dob ; permission_id ; etc...  
    Roles       | id ; add_post ; edit_post ; delete_post ; add_user ; etc...
    Permissions | id ; user_id ; role_id 
    

提交回复
热议问题