apache / apache/casbin

[Question] Condition Role Manager can support pattern domain For user -> role link

Open
#1,354 3 comments 0 reactions 1 assignee Claimed by @hsluoyz View on GitHub
question
Dominant language
Go
Stars
20.4k
Forks
1.8k
Avg merge
5d 11h
Merged PRs (30d)
2

Description

**Want to prioritize this issue? Try:**

[![issuehunt-to-marktext](https://github.com/BoostIO/issuehunt-materials/raw/master/v1/issuehunt-button-v1.svg)](https://issuehunt.io/r/casbin/casbin)

------

**What's your scenario? What do you want to achieve?**
I have temporary role and assign it some domain that I will use pattern to replace, below model
and policy will failure to enforce, if i change pattern domain to static domain, it will pass, I have
no idea, can you help me to solve it?

**Your model:**

```ini
[request_definition]
r = sub, dom, obj, act

[policy_definition]
p = sub, dom, obj, act, eft

[role_definition]
g = _, _, _, (_, _)

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

[matchers]
m = g(r.sub, p.sub, r.dom) && r.dom == p.dom && (r.obj == p.obj || p.obj == '*') && (r.act == p.act || p.act == '*')
```

**Your policy:**

```
p, data2_admin, domain1, data2, read, allow
p, data2_admin, domain2, data2, write, allow

g, alice, data2_admin, *, _, _
```

**Your request(s):**

```
alice, domain1, data2, read ---> false (expected: true)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.