This is an add that I built that allows my team members to upload there documents to RStudio Connect, and they they are added as collaborators of the document that they upload.
My question is around the type of functions these collaborators have access to on RStudio Connect.
Why are they not able to delete a document that they uploaded? But they are a collaborator of the document.
Hi @zuki! We are glad to hear this API process is working for you! Any feedback you have on the process or on what privileges it would be ideal to pass along to your users would be great for us to have as we continue to improve the product!
This is a great example - the ability to "delete" the content is reserved for the owner of the content (you) and administrators on the server. This is a safeguard, so that a collaborator cannot "go rogue" and delete content that they are not the owner of.
However, I can also see how this would be a confusing delineation! The collaborator and owner are very similar for most privilege (access to change parameters on reports, set tags, look at logs, deploy new versions, etc.). However, there are exceptions (like deleting content), and at one point there were limitations on whether collaborators could receive email updates (on failure) or view the usage data for an application. Those may or may not still exist... I know there has been discussion on removing those restrictions for collaborators.
On the "delete" topic, one option would be to have a "to_delete" tag that users could mark content with. I realize that is much less than ideal, but it would make it easier for you to follow up (either manually or programmatically) to delete content that needs to be cleaned up.
I hope that helps!! We will definitely share this feedback with our team!
Actually, one other option that just shipped in the latest version of RStudio Connect (1.8.6) - you can change the owner of content if you are an administrator on the server!! This might be a good solution for your case.
This is not exposed directly in the connectapi package (yet), but you would basically do something like:
In sum, you are right! The $update(owner_guid = ...) function needed to be ported to the newer version of the API. It also requires RStudio Connect 1.8.6. If you update to the newest version of the connectapi package (0.1.0.9018 at the time of writing) and ensure you are running RStudio Connect version 1.8.6 (latest patch release is 1.8.6.2), then this function should work now!
Please let us know if you run into any more trouble!! Hopefully this will fix your issue!
Thanks for the response @cole the current version we are using is 1.7.6. I think for now I'll just use your suggestion and create a "delete" tag that will allow the collaborators to mark the reports that they want deleted.
I'm not sure if you can advise on another issue I have, some of the users are complaining that sometimes when they upload reports to Rstudio Connect they overwrite reports that had already been uploaded. Is there a way I can prevent this from happening? The reports have different names so I don't understand why the overwriting happens. I ran the app using Rstudio to see if maybe it produces an error that could explain why the overwriting is happening, but there wasn't an error just a message that says:
Are you sure that the "name"s are different? It is worth noting that the "name" and the "title" are two distinct arguments, and two distinct things. Titles can be the same with no consequence, but names not being unique will cause deployment to the same location.
At present, it looks like the default name argument (connectapi:::create_random_name()) is being used. In any case, a 25 character random-name is very unlikely to have a duplicate, but it is possible, and would be more likely if set.seed() or some other code is being used to make your code's randomness deterministic. Do you mind sharing the code that is generating this error / output?
One way to test the result is to look at content with that name:
client <- connect()
# or whichever name is of interest
get_content(client, filter = list(name = "tfoykjedzwblzvacjrdorqngn"))
Another way would be to provide the name argument directly to deploy() ensure it is unique!
Apologies for the delay getting back to this @Zuki. Your app looks normal to me, so I am very surprised this is happening. The odds of a duplicate (the default length of our "random name" is 25 characters) is vanishingly small.
Something I thought you might try is creating your own name = argument that you ensure is unique, somehow? Alternatively, you could dig into your app to see if there is a reason that duplication is happening. For example, set.seed() will make things deterministic, so you could always set seed to a new value?
See below, which should always return the same values:
I'm asking because the overwrite issue only happens when the app is being run on Rstudio Connect, when I run the app Rstudio Server the app works perfectly and there is no overwrite problem.
That error mostly would result in functionality not working / etc. (i.e. if you try to access an API that was not in version 1.7.6 of Connect).
Thanks for the detail on things not working when deployed to RStudio Connect! I will take a look at that and see if I can reproduce in that environment!