Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum
A

This is my confusion

keep it in memory, the policy has tenant info

if there is a new signup, I add to policy and restart?

A

I haven't tested database adapters yet, but does they query database on each request?

A

in my case, I am trying to understand rbac with domain.

And my domains are my client's.

They should have their own set of roles

A

The policy is hard coded in the example and as far as I can understand, casbin does not cache the change in database?

We are in microservice arch and there are instances of app that is running parallel.

So, few services fetch the updated roles, some don't

A

and that seems not possible with casbin for now. ?

A

@sang6196 how do you manage updated policies if there are more than one instance of service?

I was under the impression that a csv file would be enough if I have to just check roles permission with static policies. However, the thing is we are b2b saas and our customers would like to create users in their account

A

Creating one per request is gonna be so slow.

Actually, you should think of casbin as static ruleset for roles. Casbin should authorize based on the role and matchers.

Do not put your users in policy and fetch their role in middleware and enforce.

A

Thank you @hsluoyz

I am considering to use it in our two application:

  • One requires usual owner access, and reseller access who can access multiple accounts
  • Other app is multi-tenant where domain base rbac is required.