My firebase database looks like below:

Suppose I have 50 users and I want to give access to node code-1 to user 1-20, code-2 to user 21-40 and code-3 to user 41-50. I have some problem and I don't want to use firebase authentication. Is there any way to do so? like sending data from user to firebase and then complete checking in Realtime database rules section and then grant permission.