C++ port: Setting a user's role