Merge branch 'adAuth' into 'main'

add ad policies

See merge request v3/service/auth!35
This commit is contained in:
Sylvain Briat 2023-05-04 12:50:19 +00:00
commit d9cedc5297
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 default allow := false
allow := true { allow {
input.uuid == input.owner input.uuid == input.owner
} }
allow := true { allow {
input.role == "admin" input.role == "admin"
} }