Update function get user by role to support rid also