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

Should be ready for a review.
`perm` and `permission_name` aren't used consistently