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

Hey folks so I am using a combination of pycasbin to create policies and casbin-rs to read the policies -

My current table looks like the following -

My model file -
`
[request_definition]
r = tier, role, tag, act
r2 = role, act

[policy_definition]
p = priority, tier, policy, tag, act, eft
p2 = priority, policy, act, eft

[role_definition]
g = _, _ # role - policy mapping

[policy_effect]
e = priority(p.eft) || deny

[matchers]
m = (g(r.role, p.policy) && (r.tier == p.tier p.tier == "") && (r.tag == p.tag p.tag == '') && (r.act == p.act p.act == '')) r.role == 'superadmin'
m2 = (g(r2.role, p2.policy) && (r2.act == p2.act p2.act == '
')) r2.role == 'superadmin'`

How ever when I load the policy for casbin rs, I get the error -

thread 'tokio-runtime-worker' panicked at 'called Result::unwrap() on an Err value: AdapterError(AdapterError(SqlxError(ColumnDecode { index: "6", source: UnexpectedNullError })))', fennel/src/auth/casbin.rs:47:14

any ideas ?

image.png

I have a feeling that for p2 kind of policies it is expecting some value for v5 ( the the 7th column ) but it is null ?

3views
2users
1 minread

Looks like sql adapters in python keep columns null and those in rust keep them not null. @hsluoyz do you know of a python sql adapter that keeps it non null or rust sql adapter than keeps it null ?

your text is too long, can you create a github issue instead?

1 / 3
Sep 2023