Fix silly bugs in comment rules I made
This commit is contained in:
parent
b942e65bb7
commit
34930fa6e3
|
@ -49,14 +49,14 @@ service cloud.firestore {
|
||||||
// it's a bad look if someone can impersonate other ids/names/avatars so check everything
|
// it's a bad look if someone can impersonate other ids/names/avatars so check everything
|
||||||
let user = get(/databases/$(database)/documents/users/$(userId));
|
let user = get(/databases/$(database)/documents/users/$(userId));
|
||||||
return comment.userId == userId
|
return comment.userId == userId
|
||||||
&& comment.userName == user.name
|
&& comment.userName == user.data.name
|
||||||
&& comment.userUsername == user.username
|
&& comment.userUsername == user.data.username
|
||||||
&& comment.userAvatarUrl == user.avatarUrl
|
&& comment.userAvatarUrl == user.data.avatarUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
match /{somePath=**}/comments/{commentId} {
|
match /{somePath=**}/comments/{commentId} {
|
||||||
allow read;
|
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} {
|
match /{somePath=**}/answers/{answerId} {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user