enhancement: Evaluate policy resource information on single file shares (#6888)

* enhancement: Evaluate policy resource information on single file shares

* enhancement: switch to resource name evaluation for example rego put rule
This commit is contained in:
Florian Schade
2023-07-31 12:12:56 +02:00
committed by GitHub
parent 5b26de71d4
commit 90ba75e27e
8 changed files with 357 additions and 26 deletions
@@ -6,14 +6,28 @@ import data.utils
default granted := true
granted = false if {
print("PRINT MESSAGE EXAMPLE")
input.request.method == "PUT"
not startswith(input.request.path, "/ocs")
not utils.is_extension_allowed(input.request.path)
pathPrefixes := [
"/dav",
"/remote.php/webdav",
"/remote.php/dav",
"/webdav",
]
restricted := pathPrefixes[_]
startswith(input.request.path, restricted)
not utils.is_extension_allowed(input.resource.name)
}
granted = false if {
input.request.method == "POST"
startswith(input.request.path, "/remote.php")
pathPrefixes := [
"/data",
"/dav",
"/remote.php/webdav",
"/remote.php/dav",
"/webdav",
]
restricted := pathPrefixes[_]
startswith(input.request.path, restricted)
not utils.is_extension_allowed(input.resource.name)
}