Perhaps you should redefine your design. I would say that it would be preferable to define two classes:
A custom class can have a set of roles. This will simplify and simplify the entire design.
A user can have one, one, or different roles. But the User is not inherently any of the roles that he may have. He simply has the ability to take on the role.
But of course, you can use the Decorator template here, as indicated by another poster.
source share