Skip to main content
Solved

Share a FME Server repository via REST API (v3)


krlem
Contributor
Forum|alt.badge.img+4
  • Contributor

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.

Best answer by todd_davis

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

View original
Did this help you find an answer to your question?

3 replies

laurawatsafe
Safer
Forum|alt.badge.img+11

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:


todd_davis
Influencer
Forum|alt.badge.img+22
  • Influencer
  • Best Answer
  • March 22, 2018

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


krlem
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 23, 2018

Thank you @todd_davis and @LauraAtSafe - I was able to grant permissions to a user.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings