-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
0 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,5 @@ | ||
--------------------- | ||
Access control policy | ||
--------------------- | ||
|
||
An example to test access controll policies. |
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,61 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. | ||
@prefix log: <http://www.w3.org/2000/10/swap/log#>. | ||
@prefix list: <http://www.w3.org/2000/10/swap/list#>. | ||
@prefix rule: <http://eyereasoner.github.io/rule#>. | ||
@prefix : <urn:example:>. | ||
|
||
:test1 | ||
:policy :PolicyX; | ||
:has :A, :B, :C. | ||
|
||
:PolicyX | ||
a :Policy; | ||
:allOf :A, :B; | ||
:anyOf :C; | ||
:noneOf :D. | ||
|
||
[] a rule:BackwardRule; | ||
rule:premise ( | ||
(_:Test :policy _:Pol) | ||
(_:Pol rdf:type :Policy) | ||
((((_:Pol :allOf _:Field)) ((_:Test :has _:Field))) log:forAllIn _:X) | ||
); | ||
rule:conclusion ( | ||
(_:Pol :pass :allOfTest) | ||
). | ||
|
||
[] a rule:BackwardRule; | ||
rule:premise ( | ||
(_:Test :policy _:Pol) | ||
(_:Pol rdf:type :Policy) | ||
((_:Field ((_:Pol :anyOf _:Field) (_:Test :has _:Field)) _:List) log:collectAllIn _:X) | ||
(_:List list:length _:L) | ||
(_:L log:notEqualTo 0) | ||
); | ||
rule:conclusion ( | ||
(_:Pol :pass :anyOfTest) | ||
). | ||
|
||
[] a rule:BackwardRule; | ||
rule:premise ( | ||
(_:Test :policy _:Pol) | ||
(_:Pol rdf:type :Policy) | ||
((_:Field ((_:Pol :noneOf _:Field) (_:Test :has _:Field)) _:List) log:collectAllIn _:X) | ||
(_:List list:length _:L) | ||
(_:L log:equalTo 0) | ||
); | ||
rule:conclusion ( | ||
(_:Pol :pass :noneOfTest) | ||
). | ||
|
||
[] a rule:QueryRule; | ||
rule:premise ( | ||
(_:Pol rdf:type :Policy) | ||
(_:Pol :pass :allOfTest) | ||
(_:Pol :pass :anyOfTest) | ||
(_:Pol :pass :noneOfTest) | ||
); | ||
rule:conclusion ( | ||
(:test :for _:Pol) | ||
(:test :is true) | ||
). |
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,2 @@ | ||
<urn:example:test> <urn:example:for> <urn:example:PolicyX>. | ||
<urn:example:test> <urn:example:is> true. |
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,2 @@ | ||
#!/bin/bash -x | ||
eye --quiet --nope --legacy acp.ttl --output out/acp.ttl.out |