Permissions working now
Some bugfixes in permissions
Bugfix syncstore, idb wasn't overwritten when _rev conflicts on WS update.