even though I think I understand the hierarchy of roles in WordPress, I never really bothered creating my own user roles or custom capabilities.
What I need to achieve is to assign a few capabilities to certain users (who might belonging to different roles: authors, subscribers, contributors...). I plan to use these capabilities to assign some badges in my BuddyPress driven community or to trigger some actions/events in other contexts (discounts in a WooCommerce store for example). At the moment I do not plan to use these to restrict content access.
I understand that WordPress does not allow users to have multiple roles (and this is a bit frustrating). Yet I don't know how to address my case. I might want to have a subscriber with a new capability "x" and also a contributor with new capability "x" or as well as some subscribers with capability "y" but not "x". It's really impractical to me to create several new user roles only to match all the combinations.
An alternative approach would be one similar to bbPress. I noticed that bbPress has its own user roles, which can be assigned to users who may have any WordPress roles. How to do someting alike with my own roles? (and being able to edit such roles for users from the user admin panels?)
Or yet alternatively should I forget about user roles/capabilities and use user_meta instead?