# hasAccessRight

Check if your application has been granted access rights or not in [EMOTIV Launcher](https://emotiv.gitbook.io/emotiv-launcher/).

{% hint style="success" %}
Any application that connects to Cortex must request approval from the user through [EMOTIV Launcher](https://emotiv.gitbook.io/emotiv-launcher/). See [requestAccess](https://emotiv.gitbook.io/cortex-api/authentication/requestaccess) for details.
{% endhint %}

## Parameters

| Name         | Type     | Required | Description                                  |
| ------------ | -------- | -------- | -------------------------------------------- |
| clientId     | `string` | yes      | The client id of your Cortex application     |
| clientSecret | `string` | yes      | The client secret of your Cortex application |

## Result

The result is an object containing a boolean value "accessGranted" and a message.

| Name          | Type      | Description                                                                                                                              |
| ------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| accessGranted | `boolean` | <p>True, if the user has already approved your application<br>False, if the user declined your application, or didn't approve it yet</p> |
| message       | `string`  |                                                                                                                                          |

If **accessGranted** is false, then your application should call [requestAccess](https://emotiv.gitbook.io/cortex-api/authentication/requestaccess)\
If **accessGranted** is true, then no action is required

## Examples

{% tabs %}
{% tab title="Request" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "hasAccessRight",
    "params": {
        "clientId": "xxx",
        "clientSecret": "xxx"
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "accessGranted":true,
        "message":"The User has granted access right to this application."
    }
}
```

{% endtab %}
{% endtabs %}
