question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Zxillycommented, Jun 13, 2021

working on this

1reaction
hsluoyzcommented, Jun 9, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Question] Enforce() returns false but expected true for ABAC ...
I am trying to check below policy on editor , But in both cases i am getting false. Your model: [request_definition] r =...
Read more >
How to check if String ends with String - Stack Overflow
Complete the solution so that it returns true if the first argument (string) passed in ends with the 2nd argument (also a string)....
Read more >
AWS global condition context keys
Works with Boolean operators. Use this key to check whether the request was sent using SSL. The request context returns true or false...
Read more >
Polar Syntax - Oso Library Documentation
Polar parses the keywords true and false as boolean values. ... The not operator will succeed when its argument fails. ... person =...
Read more >
Programming in Standard ML
We use a similar technique to implement matching against an iterated regular expression — we attempt to match the null string, but if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found