I’m using FME Server 2017.1.1.1 and REST API to create a repository and publish workspace into it. This is fairly straightforward. Once done, I’d like to share that repository with other users already existing on the server. Is there a way to do it via REST API? I wasn’t able to find it in API documentation.
Hi @krlem
Are you looking for a way to replicate clicking on the Share with Others button from the Server Web Interface using the REST API? That action isn't currently exposed in the REST API itself at this point. If it's something you'd like to see, I'd definitely recommend posting this to our Ideas page (https://knowledge.safe.com/content/idea/list.html).
The REST API does have options for setting security permissions for users though, so you could give other users permission to access the Repository that way instead. For example, you could use the call to /security/categories/< category >/resources/< resource >/roles (documented here) to give a user full access to the Repository you want. For this, the category you'd want to use is Repositories and the resource would be the actual name of the repository you want to share. For example, this is what a request to share the Dashboards repository with a user named myNewUser might look like:
Good question...because it is hard to find and I don't know why, but the logic seems weird (I may have it wrong)
POST /security/categories/< category >/resources/<
resource >/roles
Example
Category: Repositories
Resource: Dashboards
Roles: fmeguest
That give full permissions to the role for that repository. But then I if you don't want full access it is:
PUT /security/categories/< category >/resources/<
resource >/roles/< role >
using one/some of the following permissions
"REPOSITORY_DOWNLOAD",
"REPOSITORY_READ",
"REPOSITORY_WRITE",
"REPOSITORY_EXECUTE",
"REPOSITORY_DELETE
Thank you @todd_davis and @LauraAtSafe - I was able to grant permissions to a user.