Cannot update group owners via Ruby or REST API


(Benjamin Borowski) #1

The ruby API shows an option to assign owner_usernames on create_group and update_group. The create_group seems to work (and the owner is there after the group is created) but it appears that owner_usernames are only assignable on create on the REST side of things. So we can’t promote a user to an existing group owner without the UI (at least with the Ruby API).

Is this by design or is this worth a PR? Am I correct in assuming the Ruby side of things would need matching methods for groups#add_owners and groups#remove_owner?


(Régis Hanol) #2

The UI is using the API. Have you tried this?


(Benjamin Borowski) #3

Thanks, Régis. I’m not seeing anything for ownership in discourse_api/groups.rb at master · discourse/discourse_api · GitHub. I was just checking to make sure I wasn’t missing something. I can certainly just do a put request to the /admin/groups/:group_name/owners API endpoint directly without a method in the Ruby API.


(Sam Saffron) #4

The API gem may have some gaps, if you find any feel free to plug them in with PRs.

image