Skip to content

Latest commit

 

History

History
112 lines (72 loc) · 3.51 KB

File metadata and controls

112 lines (72 loc) · 3.51 KB

HyperstackApi.AssigningMemberRoleApi

All URIs are relative to https://infrahub-api.nexgencloud.com/v1

Method HTTP request Description
assignRBACRoleToUser PUT /auth/users/{user_id}/assign-roles Assign RBAC Role
removeRBACRoleFromUser DELETE /auth/users/{user_id}/roles Remove RBAC Role From User

assignRBACRoleToUser

RbacRoleDetailResponseModel assignRBACRoleToUser(userId, payload)

Assign RBAC Role

Assigns a specific RBAC role to a user within your organization, granting them access to the resource actions permitted by the role. Provide the user ID in the path and the role ID in the request body. For additional information, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.AssigningMemberRoleApi();
let userId = 56; // Number | 
let payload = new HyperstackApi.AssignRbacRolePayload(); // AssignRbacRolePayload | 
apiInstance.assignRBACRoleToUser(userId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
userId Number
payload AssignRbacRolePayload

Return type

RbacRoleDetailResponseModel

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

removeRBACRoleFromUser

CommonResponseModel removeRBACRoleFromUser(userId)

Remove RBAC Role From User

Removes an RBAC role from a user within your organization, revoking the resource permissions they had access to. Provide the user ID in the path. For additional information, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.AssigningMemberRoleApi();
let userId = 56; // Number | 
apiInstance.removeRBACRoleFromUser(userId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
userId Number

Return type

CommonResponseModel

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json