You can extend and replace any JPA entity provided by an add-on:
You can also extend and replace any screen from an add-on: use “Override an existing screen” for this.
But regarding role entities, it’s complicated. The roles you see in the UI are actually DTO entities (
RowLevelRoleModel), because they correspond to both annotated role classes and database roles. So I would recommend using security roles as is and introduce additional features in your own entities, maybe referencing roles by their codes. You can get the role model class by code using