def manage_user(uuid, superuser, options={})
      uid      = LoginUserManager.uuid_to_uid(uuid)
      username = uid_to_username(uid)
      force    = options[:force] || false
      disable  = options[:disable] || false

      if ( force && uid_exists?(uid) ) || uid_exists?(uid, ['rightscale'])
        modify_user(username, disable)
        action = superuser ? :add : :remove
        modify_group('rightscale_sudo', action, username) if group_exists?('rightscale_sudo')

        username
      else
        false
      end
    end
def manage_user(uuid, superuser, options={})
      uid      = LoginUserManager.uuid_to_uid(uuid)
      username = uid_to_username(uid)
      force    = options[:force] || false
      disable  = options[:disable] || false

      if ( force && uid_exists?(uid) ) || uid_exists?(uid, ['rightscale'])
        modify_user(username, disable)
        action = superuser ? :add : :remove
        modify_group('rightscale_sudo', action, username) if group_exists?('rightscale_sudo')

        username
      else
        false
      end
    end
If the given user exists and is RightScale-managed, then ensure his login information and
 group membership are correct. If force == true, then management tasks are performed
 irrespective of the user's group membership status.

 === Parameters
 uuid(String):: RightScale user's UUID
 superuser(Boolean):: whether the user should have sudo privileges
 force(Boolean):: if true, performs group management even if the user does NOT belong to 'rightscale'

 === Options
 :force:: if true, then the user will be updated even if they do not belong to the RightScale group
 :disable:: if true, then the user will be prevented from logging in

 === Return
 username(String):: if the user exists, returns his actual username
 false:: if the user does not exist