Skip to main content
Solved

FME REST: How to change ownership

  • February 5, 2020
  • 3 replies
  • 25 views

helmoet
Forum|alt.badge.img+8

Hi, I tried to find a way to change the ownership of an item in FME Server using REST API. There seems to be no possibility?

Best answer by nielsgerrits

When I test in the GUI (Security, Items, Repositories, check Repository, hit Change Owner, select other user, OK) it does a PUT on https://fmeservername.com/fmerest/v3/security/categories/Repositories/resources/repositoryname

The body is

{
    "owner": "newowner",
    "clientID": "repositoryname",
    "displayName": "repositoryname",
    "rolePermissions": [{
        "permissions": ["REPOSITORY_DOWNLOAD", "REPOSITORY_READ", "REPOSITORY_WRITE", "REPOSITORY_EXECUTE", "REPOSITORY_DELETE"],
        "name": "user:oldowner"
    }],
    "roles": ["user:user:oldowner"],
    "name": "repositoryname",
    "category": "Repositories"
}

So I think you need:

PUT /security/categories/< category >/resources/< resource > Replace resource metadata

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+61
  • Best Answer
  • February 5, 2020

When I test in the GUI (Security, Items, Repositories, check Repository, hit Change Owner, select other user, OK) it does a PUT on https://fmeservername.com/fmerest/v3/security/categories/Repositories/resources/repositoryname

The body is

{
    "owner": "newowner",
    "clientID": "repositoryname",
    "displayName": "repositoryname",
    "rolePermissions": [{
        "permissions": ["REPOSITORY_DOWNLOAD", "REPOSITORY_READ", "REPOSITORY_WRITE", "REPOSITORY_EXECUTE", "REPOSITORY_DELETE"],
        "name": "user:oldowner"
    }],
    "roles": ["user:user:oldowner"],
    "name": "repositoryname",
    "category": "Repositories"
}

So I think you need:

PUT /security/categories/< category >/resources/< resource > Replace resource metadata


helmoet
Forum|alt.badge.img+8
  • Author
  • February 11, 2020

When I test in the GUI (Security, Items, Repositories, check Repository, hit Change Owner, select other user, OK) it does a PUT on https://fmeservername.com/fmerest/v3/security/categories/Repositories/resources/repositoryname

The body is

{
    "owner": "newowner",
    "clientID": "repositoryname",
    "displayName": "repositoryname",
    "rolePermissions": [{
        "permissions": ["REPOSITORY_DOWNLOAD", "REPOSITORY_READ", "REPOSITORY_WRITE", "REPOSITORY_EXECUTE", "REPOSITORY_DELETE"],
        "name": "user:oldowner"
    }],
    "roles": ["user:user:oldowner"],
    "name": "repositoryname",
    "category": "Repositories"
}

So I think you need:

PUT /security/categories/< category >/resources/< resource > Replace resource metadata

O wow, it works (if you replace the "user:user" by "user"). Thanks Niels!


nielsgerrits
VIP
Forum|alt.badge.img+61

O wow, it works (if you replace the "user:user" by "user"). Thanks Niels!

Ah thanks for the feedback.