# PowerIAM.AccessApi

All URIs are relative to *http://localhost:9000*

Method | HTTP request | Description
------------- | ------------- | -------------
[**assurePermissions**](AccessApi.md#assurePermissions) | **GET** /v2/assure-permissions | 
[**getPermissionsGranted**](AccessApi.md#getPermissionsGranted) | **GET** /v2/get-permissions-granted | 

<a name="assurePermissions"></a>
# **assurePermissions**
> &#x27;Boolean&#x27; assurePermissions(opts)



Assure a user has a certain set of permissions, in the world or in a realm. Leave the UserId parameter empty to assure for authenticated user.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.AccessApi();
let opts = { 
  'inRealmId': "inRealmId_example", // String | 
  'inExternalRealmId': "inExternalRealmId_example", // String | 
  'permissions': ["permissions_example"], // [String] | 
  'userId': "userId_example" // String | 
};
apiInstance.assurePermissions(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **inRealmId** | **String**|  | [optional] 
 **inExternalRealmId** | **String**|  | [optional] 
 **permissions** | [**[String]**](String.md)|  | [optional] 
 **userId** | **String**|  | [optional] 

### Return type

**&#x27;Boolean&#x27;**

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="getPermissionsGranted"></a>
# **getPermissionsGranted**
> [PermissionV2] getPermissionsGranted(opts)



Get all permissions a user has been granted, in the world or in a realm.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.AccessApi();
let opts = { 
  'toUserId': "toUserId_example", // String | 
  'inRealmId': "inRealmId_example" // String | 
};
apiInstance.getPermissionsGranted(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **toUserId** | **String**|  | [optional] 
 **inRealmId** | **String**|  | [optional] 

### Return type

[**[PermissionV2]**](PermissionV2.md)

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

