How do I apply a class to custom menu items based on user roles

WRT to your question “need to apply the class if another class is present and the user’s role is (whatever)”

The easiest was to do this, isn’t in the code, but yet in the CSS. You can target an element that has more then once class. So, using your class PARTNER_STAR and if your other class is say another you can have your css such that

.another { /* targets all elements with another set */ }
.PARTNER_STAR { /* targets all elements with PARTNER_STAR set */ }
.another.PARTNER_STAR { /* targets elements that have BOTH PARTNER_STAR and another set */ }

Tying in the idea of @robertwbradford you can just set one parent element, and don’t need it on every single one. If you have multiple roles, that just need one style, you can still have your if statement, just apply the css to a high-level parent element.

.PARTNER_STAR .another { /* targets all elements with another inside PARTNER_STAR */ }