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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user