This are my rules, applied to an img dir:
match /img {
match /{fileId} {
allow read,
write: if request.resource.contentType.matches('image/jpeg')
|| request.resource.contentType.matches('image/png')
|| request.resource.contentType.matches('image/gif')
&& request.resource.size < 2 * 1024 * 1024
}
}
}
The problem is that those rules are also being applied to delete() as it is a write method too, so it always returns a permission error. I couldn't find anything in the documentation regarding this. How can I defer from POST/PUT rules and DELETE rules?