code: @Override
  	public void setRole(String username, String newrole) throws RolesException {
  		List<String> users_with_role = new ArrayList<String>();
  
  		if (user_list.containsKey(username)) {
  			List<String> roles_of_user = user_list.get(username);
  			if (!roles_of_user.contains(newrole)) {
  				// Update our user list
  				roles_of_user.add(newrole);
  				user_list.put(username, roles_of_user);
  				// Update our roles list
  				if (role_list.containsKey(newrole))
  					users_with_role = role_list.get(newrole);
  				users_with_role.add(username);
  				role_list.put(newrole, users_with_role);
  
  				// Don't forget to update our file_store
  				String roles = StringUtils.join(roles_of_user.toArray(new String[0]), ",");
  				file_store.setProperty(username, roles);
  
  				// And commit the file_store to disk
  				try {
  					saveRoles();
  				} catch (IOException e) {
  					throw new RolesException(e);
  				}
  			} else {
  				throw new RolesException("User '" + username + "' already has role '" + newrole + "'!");
  			}
  		} else {
  			// Add the user
  			List<String> empty = new ArrayList<String>();
  			user_list.put(username, empty);
  			// Try again
  			this.setRole(username, newrole);
  		}
  	}
docs: Assign a role to a user.
  
  @param username
  The username of the user.
  @param newrole
  The new role to assign the user.
  @throws RolesException
  if there was an error during assignment.