Solution:
If you don’t mind using a plugin that’s up to date then this one will do everything you’ve asked for and has been regularly updated and has over 40,000 active installs.
User Access Manager
https://wordpress.org/plugins/user-access-manager/