Firebase read, write only if tag contains certain data

i have an issue im trying to make it so i could read or write in real time database if tag contains auth UID (tag looks like that uid;uid2 ) but i need to get tag list even if this user uid isnt in the one but i get firebase error saying i dont have a permission , any help?