casbin / casbin-pg-adapter

A go-pg adapter for casbin
https://github.com/casbin/casbin
Apache License 2.0
38 stars 28 forks source link

Policies with more than 6 values #7

Closed flusflas closed 4 years ago

flusflas commented 4 years ago

I've noticed that only 6 (and always 6) parameters are allowed in policies, although Casbin accepts (I think) an arbitrary number of values. These 6 values are hard coded, even though it could be easily parametrized. Is there any performance/limitation reason for this implementation?

pckhoi commented 4 years ago

Hmm, never really questioned whether Casbin accepts an arbitrary number of values. Yes, this adapter only save 6 values per policy. Not sure why it is 6 but it ought to be enough for 99% of all use cases out there.

What use case are you having?

pckhoi commented 4 years ago

It listed here the supported models: https://casbin.org/docs/en/supported-models

and none of them need more than 6 values.

flusflas commented 4 years ago

Ok, I just wanted to know if there was any limitation behind this. I shouldn't need more than 6 values, but I wanted to know how limited I was. Thanks!

hsluoyz commented 4 years ago

The number of values has to be a fixed value. I thought 6 would be enough for 99.9% cases. If you need > 6 values, you can modify the source code.