Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description conflict of policy filter #105

Open
sagilio opened this issue Oct 4, 2022 · 2 comments
Open

Description conflict of policy filter #105

sagilio opened this issue Oct 4, 2022 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@sagilio
Copy link
Member

sagilio commented Oct 4, 2022

There may be two different structure descriptions of the policy filter:

enforcer.InitWithAdapter("examples/rbac_with_domains_model.conf", adapter)
filter := &fileadapter.Filter{
P: []string{"", "domain1"},
G: []string{"", "", "domain1"},
}
enforcer.LoadFilteredPolicy(filter)
// The loaded policy now only contains the entries pertaining to "domain1".

* `LoadFilteredPolicy` requires a `filter` as parameter. The filter should be something like this.
```json
{
"p":[ [ "alice" ], [ "bob" ] ],
"g":[ [ "", "book_group" ], [ "", "pen_group" ] ],
"g2":[ [ "alice" ] ]
}
```

@casbin-bot
Copy link
Member

@casbin-bot casbin-bot added the question Further information is requested label Oct 4, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Oct 4, 2022

@sagilio why the 2nd code is 2D-array?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants