Fix silly bugs in comment rules I made

This commit is contained in:
Marshall Polaris 2022-04-27 01:15:28 -07:00
parent b942e65bb7
commit 34930fa6e3

View File

@ -49,14 +49,14 @@ service cloud.firestore {
// it's a bad look if someone can impersonate other ids/names/avatars so check everything
let user = get(/databases/$(database)/documents/users/$(userId));
return comment.userId == userId
&& comment.userName == user.name
&& comment.userUsername == user.username
&& comment.userAvatarUrl == user.avatarUrl
&& comment.userName == user.data.name
&& comment.userUsername == user.data.username
&& comment.userAvatarUrl == user.data.avatarUrl;
}
match /{somePath=**}/comments/{commentId} {
allow read;
allow create: if request.auth != null && commentMatchesUser(request.resource.data, request.auth.uid);
allow create: if request.auth != null && commentMatchesUser(request.auth.uid, request.resource.data);
}
match /{somePath=**}/answers/{answerId} {