[3.9] Add User repositories functions

Needs #588 to be merged first to enable tests that require deleted field