I'm trying to create a new role using the drupal services module. I am able to update a user with an already created role but can't find a way to add a new role. I'd rather not build a custom service for this so wondering if anyone knows of a way to do this without resorting to that.
First of All you could create the custom resource in a custom module and enable it, for doing that follow that tutorial
Second in the callback function use that code to create a new role
$role = new stdClass(); $role->name = 'editor'; // $role->weight = 10; user_role_save($role);
Let the role name be an argument taken from the request.