Layer7 API Management

  • 1.  How can role be assigned to a user that is created using Restman?

    Posted Aug 24, 2018 08:43 PM

    I was able to create a user using restman interface. But I do not know how to assign a role to it. Without any role assigned to it, the user is not able to login. Administrator has to assign a role to the newly created user, which again is a manual process.



  • 2.  Re: How can role be assigned to a user that is created using Restman?
    Best Answer

    Posted Aug 26, 2018 05:03 AM

    Hi,

     

    You can do a GET https://<your_ssg>:8443/restman/1.0/roles to get the ID of the administrator role.

     

    Next, you can add a user to that role by doing a PUT https://<your_ssg>:8443/restman/1.0/roles/<administrator_role_id>/assignments

     

    The Template payload for the PUT call can be retrieved from GET https://<your_ssg>:8443/restman/1.0/roles/<administrator_role_id>/assignments/template/addassignments



  • 3.  Re: How can role be assigned to a user that is created using Restman?

    Posted Aug 27, 2018 01:54 PM

    Just a quick note to also say that this question was asked here and answered by Jay: https://communities.ca.com/thread/241737028#comment-242137553 



  • 4.  Re: How can role be assigned to a user that is created using Restman?

    Posted Aug 27, 2018 08:43 PM

    Thanks for the quick response. I am able to create the user and associate the role.