fix roles bug in usercommands::register

(cherry picked from commit f75adee29a32aa7c5b2952990e40d5651f5db523)