I have played around with roles, badges, logins and all that stuff a long while ago.
But this site still exists, to make some testings…
https://russian-dima.wixsite.com/login-system/vnbadgemgm
There you will be able to use an example Login-System which uses BADGES and ROLES, fully custom-coded.
More informations about it you maybe will find in one of my numerous posts about my old little LOGIN-SYSTEM-PROJECT…