node-casbin: [Question] Enforce() returns false but expected true for ABAC & in operator

Want to prioritize this issue? Try:

issuehunt-to-marktext


What’s your scenario? What do you want to achieve? I am trying to check below policy on editor , But in both cases i am getting false.

Your model:

[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = r.sub.Owner == r.obj.Owner && r.sub.Doc in(r.obj.Docs)

Your policy:

{Owner: 'alice', Doc: 1}, { Owner: 'alice', Docs: [1,2] }
{Owner: 'alice', Doc: 1}, { Owner: 'alice', Docs: [3,4]}

Your request(s):

{Owner: 'alice', Doc: 1}, { Owner: 'alice', Docs: [1,2] } ---> false (expected: true)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

working on this

@Tapas059 we added the docs for “in” (https://casbin.org/docs/en/syntax-for-models#speical-grammer) but that’s mostly for Go, I will redirect it.