Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add prioritizing based on role and user hierarchy
Signed-off-by: tangyang9464 <tangyang9464@163.com>
- Loading branch information
1 parent
ecc6d90
commit 6091b85
Showing
8 changed files
with
173 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[request_definition] | ||
r = sub, obj, act | ||
|
||
[policy_definition] | ||
p = sub, obj, act, eft | ||
|
||
[role_definition] | ||
g = _, _ | ||
|
||
[policy_effect] | ||
e = subjectPriority(p.eft) || deny | ||
|
||
[matchers] | ||
m = g(r.sub, p.sub) && r.obj == p.obj && r.act == p.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,14 @@ | ||
[request_definition] | ||
r = sub, obj, dom, act | ||
|
||
[policy_definition] | ||
p = sub, obj, dom, act, eft #sub can't change position,must be first | ||
|
||
[role_definition] | ||
g = _, _, _ | ||
|
||
[policy_effect] | ||
e = subjectPriority(p.eft) || deny | ||
|
||
[matchers] | ||
m = g(r.sub, p.sub, r.dom) && r.dom == p.dom && r.obj == p.obj && r.act == p.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,16 @@ | ||
p, root, data1, read, deny | ||
p, admin, data1, read, deny | ||
|
||
p, editor, data1, read, deny | ||
p, subscriber, data1, deny | ||
|
||
p, jane, data1, read, allow | ||
p, alice, data1, read, allow | ||
|
||
g, admin, root | ||
|
||
g, editor, admin | ||
g, subscriber, admin | ||
|
||
g, jane, editor | ||
g, alice, subscriber |
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, admin, data1, domain1, write, deny | ||
p, alice, data1, domain1, write, allow | ||
p, admin, data2, domain2, write, deny | ||
p, bob, data2, domain2, write, allow | ||
|
||
g, alice, admin, domain1 | ||
g, bob, admin, domain2 |
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