add ad policies

This commit is contained in:
sbriat 2023-05-04 14:46:40 +02:00
parent fd8bdad946
commit 9ba715860e
5 changed files with 38 additions and 2 deletions

11
opa/ad/delete.rego Normal file
View File

@ -0,0 +1,11 @@
package AD.DELETE
default allow := false
allow {
input.userUuid == input.owner
}
allow {
input.role == "admin"
}

3
opa/ad/list.rego Normal file
View File

@ -0,0 +1,3 @@
package AD.LIST
default allow := true

11
opa/ad/read.rego Normal file
View File

@ -0,0 +1,11 @@
package AD.READ
default allow := false
allow {
input.userUuid == input.owner
}
allow {
input.role == "admin"
}

11
opa/ad/update.rego Normal file
View File

@ -0,0 +1,11 @@
package AD.UPDATE
default allow := false
allow {
input.userUuid == input.owner
}
allow {
input.role == "admin"
}

View File

@ -2,10 +2,10 @@ package USER.READ
default allow := false
allow := true {
allow {
input.uuid == input.owner
}
allow := true {
allow {
input.role == "admin"
}