Skip to content

Instantly share code, notes, and snippets.

@dabasajay
Last active June 13, 2021 00:31
Show Gist options
  • Save dabasajay/9e81bad0e1045b3d1e2d89c34de79960 to your computer and use it in GitHub Desktop.
Save dabasajay/9e81bad0e1045b3d1e2d89c34de79960 to your computer and use it in GitHub Desktop.
db/ | desc: RBAC schema

Basics

  1. Entities:
  • Resources
  • Permissions
  • Users
  • Roles or Groups
  1. Resources requires (1 or more) Permissions
  2. Roles are collection of (1 or more) Permissions
  3. Users can have (1 or more) Roles

SQL Schema

Tables:

  • Permission
  • Role
  • User
  • Role_Permission
  • User_role

NoSQL Schema

Collections:

  • User
  • Role
  • Permission

Note 📰 : Resources isn't included in these schemas. It can be done according to need.

@dabasajay
Copy link
Author

photo_2021-06-13_05-57-58

@dabasajay
Copy link
Author

photo_2021-06-13_05-58-54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment