I just wonder what is the best practice to create a good database design. It doesnt matter what kind of Database. I mean how to structure the policy and models
When the string is not stored in the database than in a static file? But why? The whole application data is stored in the database. When permission changes you need to store the data in standard format. The Users and Roles are also stored in the Database. So why not save the relations to the permissions also in the database? I can not pass the Casbin Config as it is to the Client.
@hsluoyz I understood you well. You can store it in a single Database field. The downside of it, the format as it is is useless. An userfriendly application has something where you have a permission process like this: 1. Create Users in e.g Table: User 2. Create Role in e.g. Table Role 4. Create Rights in e.g. Table Right 5. Assign Rights to Roles in e.g. Table Role_Right 6. Assign Users to Roles in e.g. Table Role_User So when you have a database design like this you have to transform the data for Casbin. Wouldnt it be easier if Casbin would a similar database design schema? In youre application you have a control or form or something for each of these objects.
- Create Users in e.g Table User
see: https://casbin.org/docs/en/overview#what-is-casbin Casbin doesn't maintain user list table because it's too customized.
- Create Role in e.g. Table Role
Call API: GetAllRoles() https://casbin.org/docs/en/management-api#getallroles
Call a lot of APIs like: https://casbin.org/docs/en/management-api#getpolicy
Call a lot of APIs like: https://casbin.org/docs/en/management-api#getpolicy
Call: https://casbin.org/docs/en/management-api#getgroupingpolicy
Casbin doesn't use the "classic" 5 table model.