connectapi icon indicating copy to clipboard operation
connectapi copied to clipboard

"owner" role in API sets the content "collaborator", not "owner", in RStudio Connect

Open fh-kpikhart opened this issue 2 years ago • 2 comments

In connectapi and the Connect API, the allowed roles when setting permissions are "viewer" or "owner" (i.e. content_add_user(content, guid, role = c("viewer", "owner"))).

These roles map to "viewer" and "collaborator" in RStudio Connect. However, in RStudio Connect, there is also the notion of a content "owner", which is altogether different from "viewer" and "collaborator". This is confusing, as we have to use the "owner" role to set a "collaborator" (but not to set an "owner") in RStudio Connect.

I'd like to request an enhancement to make the naming more consistent throughout.

Reference: https://pkgs.rstudio.com/connectapi/reference/permissions.html https://docs.rstudio.com/connect/api/#put-/v1/content/{guid}/permissions/{id}

fh-kpikhart avatar Oct 28 '22 01:10 fh-kpikhart

Thanks for reporting this!

Is your main concern having the ability to do something like set_owner(content, user_guid) as a replacement / convenience for content$update(owner_guid=user_guid)?

Or moreso the concern about the verbiage? I definitely agree that this is confusing. Unfortunately we are copying this convention directly from Connect's API (it uses the word "owner" internally to mean "collaborator" and only presents "collaborator" to the user in the UI).

As a result, this is something that we may push upstream as a desire to change the interface of the API / create other options. We could, of course, create a "wrapper" inside of connectapi that converts "owner" to "collaborator". I think this could end up being pretty confusing to users as well though 🙈

colearendt avatar Nov 24 '22 01:11 colearendt

The verbiage was my main concern (that owner translates to collaborator in the API, and there is no way to set collaborator). I agree that if connectapi wraps the API, an appropriate solution is to request a change in the API interface first, and change the package second.

fh-kpikhart avatar Feb 20 '23 19:02 fh-kpikhart