Error when updating the roles of my users

hello, thank you for your guidance. What I did was the following:

set the property $user->role_id

before calling

$this->Users->save($user)

according to my logic in this way I establish the condition before saving/updating that specific role_id

and it worked perfectly.

Thank you.