It's definitely possible, but it's not that simple in Revolution.
In Evolution, users have only one role. In Revolution, user's can have a different role in each user group they belong to.
Assuming that you know the ID of the user group, the ID of the user and the ID of the user's current role in that group and the ID of the role you want to set, it would look something like this:
<?php
$userGroupMember = $modx->getObject('modUserGroupMember', array('user_group'=>$userGroupId, 'member'=>$userId, 'role'=>$oldRole));
$userGroupMember->set('role', $newRole);
$userGroupMember->save();
The role IDs are listed in the Manager and you can get the user and group ID's like this:
<?php
$groupName = 'Editors';
$userName = 'JoeBlow';
$userGroup = $modx->getObject('modUserGroup', array('name'=> $groupName));
$userGroupId = $userGroup->get('id');
$user = $modx->getObject('modUser', array('username'=> $userName));
$userId = $user->get('id');
A whole different approach would be to add the user to another group rather than changing the user's role and give that group more rights. Then you could simply do this:
<?php
$userName = 'JoeBlow';
$user = $modx->getObject('modUser', array('username'=> $userName));
$user->joinGroup($group, $role);
In the code above, the $group and $role variables can contain either the ID or the name of the group or role.
[ed. note: BobRay last edited this post 8 years, 9 months ago.]