Skip to content

Commit eae3fa5

Browse files
NeoLegendsleolabs
andcommitted
🔒 Enforce login for cheat-prevented parties
Co-Authored-By: Leo Bernard <admin@leolabs.org>
1 parent a2e265a commit eae3fa5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

database.rules.bolt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ path /votes_by_user/{partyId}/{userId}/{trackId} is VotesPermissions {
8686
}
8787

8888
type VotesPermissions {
89-
write() { isCurrentUser(userId) }
89+
write() {
90+
isCurrentUser(userId) &&
91+
(root.parties[partyId].settings == null ||
92+
root.parties[partyId].settings.allow_anonymous_voters ||
93+
auth.provider != "anonymous")
94+
}
9095
validate() { partyExists(partyId) }
9196
}
9297

0 commit comments

Comments
 (0)