fix(authz): invalidate role cache on change

This commit is contained in:
Edouard Vanbelle
2026-07-06 23:01:37 +02:00
parent 79f4792709
commit f7deb7aaf4
7 changed files with 134 additions and 10 deletions
+6 -1
View File
@@ -150,9 +150,14 @@ while IFS= read -r drive_id; do
while IFS= read -r file_id; do
[[ -z "$file_id" ]] && continue
curl -sf -X DELETE -H "$AUTH" "$base_url/api/files/$file_id" >/dev/null
HTTP_STATUS=$(curl -s -H "$AUTH" -o /tmp/del.json -w '%{http_code}' \
-X DELETE "$base_url/api/files/$file_id")
if [[ "$HTTP_STATUS" != "204" ]]; then
log "FILE DELETE FAILED: file=$file_id drive=$drive_id ($DRIVE_NAME) status=$HTTP_STATUS body=$(cat /tmp/del.json)"
fi
done < <(echo "$CONTENTS" | jq -r '.items[] | select(.resource_type == "file") | .resource.id')
# Empty the drive's per-drive trash so D3b's "drive must be empty"
# guard passes on the delete. `/api/trash/drive/{id}` is the
# Owner-only per-drive empty (admin is Owner now via the grant