-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added enforcer context to enable multiple section type (#317)
* feat: added EnforcerContext + enforce_with_context function * fix: debug cannot derive on DefaultEffectStream on expl which has (feature = 'explain') * fix: fixed wrong macro checking for ctx * fix: pub EnforceContext to be able to import * fix: fixed nightly and beta ubuntu Error: --> src/cached_enforcer.rs:77:1 and Error: --> src/effector.rs:33:9 docs: doc on enforce_with_context * fix: clippy cleaning
- Loading branch information
Showing
9 changed files
with
342 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[request_definition] | ||
r = sub, act, obj | ||
r2 = sub, act | ||
|
||
[policy_definition] | ||
p = sub, act, obj | ||
p2 = sub, act | ||
|
||
[role_definition] | ||
g = _, _ | ||
g2 = _,_ | ||
|
||
[policy_effect] | ||
e = some(where (p.eft == allow)) | ||
e2 = some(where (p.eft == allow)) | ||
|
||
[matchers] | ||
m = r.sub == p.sub && g(p.act, r.act) && r.obj == p.obj | ||
m2 = r2.sub == p2.sub && g(p2.act, r2.act) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
p, alice , admin, project1 | ||
p, bob , user, project2 | ||
p2, james, execute | ||
|
||
g, admin, read | ||
g, admin, write | ||
g, user, read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.