/api/space/user-management/users/{id}/roles

The following operations are supported on this resource:

  • GET - Get all roles for a user
  • POST - Assign multiple roles to a user
GET /users/{id}/roles Version 1

Get all roles for a user.

Sample Usage

GET /users/{id}/roles


  • Parameters:
    Name Type URI Type Description Required
    id int Path The ID of the user whose roles are to be retrieved. Y
  • Sample Output XML:
    <roles
      size="1" uri="/api/space/user-management/users/65859/roles">
      <role key="65593" uri="/api/space/user-management/users/65859/roles/65593"
           href= "/api/space/user-management/roles/65593">
         <name>superAdmin</name>
      </role>
    </roles>

  • Sample Output JSON:
    {
      "roles": {
          "@size":"1",
          "@uri": "/api/space/user-management/users/65859/roles",
          "role": {
              "@key":"65593",
              "@uri": "/api/space/user-management/users/65859/roles/65593",
              "@href": "/api/space/user-management/roles/65593",
              "name":"superAdmin"
          }
      }
    }

  • Access Control

    The following capabilities are required to access this API: ReadRole

    POST /users/{id}/roles Version 1

    This API is used to assign multiple roles to a user.

    Sample Usage

    POST /users/{id}/roles


    • Parameters:
      Name Type URI Type Description Required
      id Integer Path The ID of the user to whom roles are to be added. Y
  • Sample Input XML:
    <roles>
        <role href="/api/space/user-management/roles/65654" />
    </roles>

  • Sample Output XML:
    <roles size="1"   uri="/api/space/user-management/users/3506200/roles">
        <role key="65658"
          uri= "/api/space/user-management/users/3506200/roles/65655"
          href="/api/space/user-management/roles/65655"> ;
          <name>jobsAdmin</name>
        </role>
    </roles>

  • Sample Input JSON:

    {
      "roles":{
           "role":[
             {
                "@href": "/api/space/user-management/roles/65654"
             }
           ]
      }

  • Sample Output JSON:
    {
      "roles":{
            "@size":"1",
            "@uri": "/api/space/user-management/users/3506200/roles",
            "role": {
                   ;"@key":"65658",
                   ;"@uri":"/api/space/user-management/users/3506200/roles/65654",
                   ;"@href":"/api/space/user-management/roles/65654",
                   ;"name":"jobsAdmin"
            }
      }
    }

  • Access Control

    The following capabilities are required to access this API: ModifyUser