def METHOD_NAME(self):
    security = get_service("security")
    current_roles = security.get_roles(self.obj, no_group_roles=True)
    current_roles = {r for r in current_roles if r.assignable}
    new_roles = {Role(r) for r in self.form.roles.data}
    for r in current_roles - new_roles:
        security.ungrant_role(self.obj, r)
    for r in new_roles - current_roles:
        security.grant_role(self.obj, r)
    return super().METHOD_NAME()