I have the following rules for uploading images in user messages, however current rules do not allow deleting a file.
How to change the rules so that the user can delete their photos?
What property in the variable requestindicates that the request DELETE?
match /{uid}/posts/{pid}/{imageName} {
allow read;
allow write: if (uid == request.auth.uid)
&& ((
((imageName == "pic.jpg") || (imageName == "pic.png") || (imageName == "pic.gif"))
&& (request.resource.size < 5 * 1024 * 1024)
&& (request.resource.contentType.matches('image/.*'))
));
}
Is there something like this ?:
request.method == "DELETE"
I can not find anything in the documentation.
source
share