How to use custom user data in custom realm flex sync permissions

Okay Thanks Kiro, I think I understand. In any case, I still have the same error as in the beginning of the thread. This custom user data object seems to be undefined… Any other ideas?