Skip to content

Commit

Permalink
docs: add examples for keyget, keyget2
Browse files Browse the repository at this point in the history
  • Loading branch information
basakest committed Sep 15, 2021
1 parent 132167b commit c717881
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/keyget2_model.conf
@@ -0,0 +1,11 @@
[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

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

[matchers]
m = r.sub == p.sub && keyGet2(r.obj, p.obj, 'resource') in ('age', 'name') && regexMatch(r.act, p.act)
11 changes: 11 additions & 0 deletions examples/keyget_model.conf
@@ -0,0 +1,11 @@
[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

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

[matchers]
m = r.sub == p.sub && (r.obj == p.obj || keyGet(r.obj, p.obj) in ('age','name')) && regexMatch(r.act, p.act)

0 comments on commit c717881

Please sign in to comment.