Android code not syncing in atlas

Hello… I started writing apps with realm locally and everything was fine.
Now, I want sync my data to atlas. I’ve used example shown in mongodb website but I still get error like : ‘user do not have permission to write on that collection’.
Do I have to change the code I’ve written for local DB?

Please, can someone give the best structure to use ?

Thanks!!