User Role

Overview

An administrator of a BIG-IQ can use the User Role API to add or remove a user from a role on the BIG-IQ. You must specify the UUID which identifies the role to add a user to that role. In the following, the UUID of the role is represented by the placeholder:<id>. An administrator can create a new user on the BIG-IQ using the User API.

REST Endpoint: /mgmt/shared/authorization/roles/<id>

Requests

GET /mgmt/shared/authorization/roles/<id>

Request Parameters

None

Query Parameters

Note that you can limit the JSON parameters returned in the body of the GET response by using the select OData query option as follows.

GET https://<BIG-IQ>/mgmt/shared/authorization/roles/<id>?$select=principalReferences,selfLink,name

Response

The JSON in the body of a GET response can contain the following parameters.

HTTP/1.1 200 OK

Name Type Description
name string The name of the role.
principalReferences array An array of link objects which lists the BIG-IQ users in the role.
     link string The URL of the user
selfLink string The URL of the role.

Permissions

Role Allow
admin Yes

PATCH /mgmt/shared/authorization/roles/<id>

To add or remove users to an existing RBAC role on the BIG-IQ, you can send a PATCH request to the collection of users for that role. The JSON in the body of the PATCH request must include a principalReferences array of link objects which must contain a link for every user you want assigned to that role.

Request Parameters

The JSON in the body of a POST request can contain the following parameters.

Name Type Required Description
principalReferences array True An array of link objects which list all the BIG-IQ users for this role. This array must include a link object for every user, the new and existing users, you want in this role. If you omit any reference link for an existing user, that user will be removed from the role. If the value of principalReferences is an empty array, then all users will be removed from the role.
     link string True The URL of the user

Query Parameters

None

Response

The JSON in the body of the response can contain the following parameters.

HTTP/1.1 200 OK

Name Type Description
name string The name of the role.
principalReferences array An array of link objects which lists the BIG-IQ users in the role.
     link string The URL of the user
selfLink string The URL of the role.

Permissions

Role Allow
admin Yes

Examples

GET to list all users in role

To list all the users in a role, send a GET to the endpoint and specify the UUID of the role, <id>. In the following the example value for <id> is d13bc5b6-8b2b-39e1-8f29-777db17cc563 which identifies the Common role.

GET https://<BIG-IQ>/mgmt/shared/authorization/roles/d13bc5b6-8b2b-39e1-8f29-777db17cc563?$select=principalReferences,selfLink,name

Response

The JSON in the response can look similar to the following example, with admin, user1 and user2 in the role.

HTTP/1.1 200 OK

{
    "name": "Common",
    "selfLink": "https://localhost/mgmt/shared/authorization/roles/d13bc5b6-8b2b-39e1-8f29-777db17cc563",
    "principalReferences": [
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user1"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user2"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/admin"
            }
    ]
}

PATCH to add a new user to role

To add a new user3, to the Common role, send a PATCH to the collection endpoint, and specify the UUID of the role, <id>.

POST https://<BIG-IQ>/mgmt/shared/authorization/roles/d13bc5b6-8b2b-39e1-8f29-777db17cc563

The JSON in the body of the PATCH contains link references for every new and existing users you want in this role.

{
    "principalReferences": [
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user1"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user2"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user3"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/admin"
            }
    ]
}

Response

The JSON in the response can look similar to the following example.

HTTP/1.1 200 OK

{
    "name": "Common",
    "selfLink": "https://localhost/mgmt/shared/authorization/roles/d13bc5b6-8b2b-39e1-8f29-777db17cc563",
    "principalReferences": [
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user1"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user2"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user3"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/admin"
            }
    ]
}

PATCH to remove a user from a role

To remove only the user3 from the role, send a PATCH to the collection endpoint, and specify the UUID of the role, <id>.

PATCH https://<BIG-IQ>/mgmt/shared/authorization/roles/d13bc5b6-8b2b-39e1-8f29-777db17cc563

The JSON in the body of the PATCH contains link references for only the users you want in this role.

{
    "principalReferences": [
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user1"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user2"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/admin"
            }
    ]
}

Response

The JSON in the response can look similar to the following example.

HTTP/1.1 200 OK

{
    "name": "Common",
    "selfLink": "https://localhost/mgmt/shared/authorization/roles/d13bc5b6-8b2b-39e1-8f29-777db17cc563",
    "principalReferences": [
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user1"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/user2"
            },
            {
                    "link": "https://localhost/mgmt/shared/authz/users/admin"
            }
    ]
}