Fixed #18763 -- Added with_perm() to User manager.

Should be ready for a review.
This is specific to the implementation in the `ModelBackend`