I am using woocommerce and woocommerce memberships to sell memberships on my site. There are multiple types of memberships:
1. Free membership – Applied if user registers
2. Basic Membership – Applied if user purchases basic/ Free membership is also applied
3. Pro membership – Applied if user purchases pro/ Free membership is also applied
There is a clear distinction between roles and memberships. Roles are used specifically to grant/ deny capabilities, where as memberships are used to give access to content, member discounts/pricing, and can also have time limits associated with them. In addition a user can have an unlimited number of memberships, they can be active/ expired cancelled etc. There are a lot of reasons why this is a better model than using capabilities on this type of site. This is fairly standard for a lot of the membership plugins (woocommerce memberships, memberpress, easy digital downloads, suremembers).
For my use case I want to require 2FA for users with Pro memberships, but make it optional for other membership types. Every user that purchases a product will automatically be assigned the customer role, but I would only want to enforce 2FA for specific users within that role.
I hope that explains my use case. Thanks