Skip to main content
Question

Setting security via REST API (v3).

  • February 15, 2018
  • 2 replies
  • 13 views

Forum|alt.badge.img

Hi,

we use role-based security, and I need to set permissions on various categories and resources for the role.

For some categories/resources, I want to give a role only a subset of permissions.

If I try to set a specific permission on a resource, say category=SharedResources, resource=FME_SHAREDRESOURCE_DATA, permission=SHAREDRESOURCE_READ,

to a role 'DUMMY' that I have previously created, I get an error saying there is no such role in the resource.

If instead I assign a role to the resource, the resource gets all permissions immediately.

If I do not want this role to be able to delete, I must now remove this permission.

Is there a more direct way to achieve what I want?

Thanks,

Michael Neidhardt

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.

2 replies

pallegama
Contributor
Forum|alt.badge.img+8
  • Contributor
  • February 16, 2018

Hi @mineisdfe,

There is no one REST API call to assign a role to a resource and configure the permission. The best way to do that is assigning the role and using PUT REST API call to set required permission(s). PUT call will replace existing permissions with defined permission(s). So you can avoid removing unnecessary permissions one by one.

1. POST /security/categories/< category >/resources/< resource >/roles

2. PUT /security/categories/< category >/resources/< resource >/roles/< role >

Hope this helps.


Forum|alt.badge.img
  • Author
  • February 23, 2018

Hi @mineisdfe,

There is no one REST API call to assign a role to a resource and configure the permission. The best way to do that is assigning the role and using PUT REST API call to set required permission(s). PUT call will replace existing permissions with defined permission(s). So you can avoid removing unnecessary permissions one by one.

1. POST /security/categories/< category >/resources/< resource >/roles

2. PUT /security/categories/< category >/resources/< resource >/roles/< role >

Hope this helps.

Hi and thanks for your reply,

 

I am not asking for a method that assigns a role and configures all permissions.

 

I am asking if there is a method that assigns a role to a resource, without also giving the role all permissions simultaneously.

 

But I suspect it's not possible with the current API.