With censhare 5.4 onwards there were Resource Replacement Variant introduced. Since 5.8 onwards please assign a role on the Resource Replacement Variant relation itself.
Steps to follow via java client:
Right click on Variant. (variant for which you want to assign a role)
Choose 'Edit relations' --> 'Resource replace variant'.
User will get a new popup dialog.
Click on + button beside Features label on new popup dialog.
Choose Resource replace role from drop down.
From second drop down choose the desired role to assign.
Steps to follow via web client:
Open the main asset or the variant asset.
Select the widget which show the variant or main asset.
Click the three dots "⋮" vertically aligned.
Choose the option 'Edit relation properties'.
A dialog will appear and choose the desired role from the dropdown.