# Permissions

If you want to read a document from the gallery, you need to make sure that your application has permission to read from external storage. You can check it using the following code:

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

```java
// checking for image browsing permissions
if (ContextCompat.checkSelfPermission(MainActivity.this,
    Manifest.permission.READ_EXTERNAL_STORAGE)
    != PackageManager.PERMISSION_GRANTED) {

    ActivityCompat.requestPermissions(MainActivity.this,
        new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
        PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
} else {
    // start image browsing
    createImageBrowsingRequest();
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// checking for image browsing permissions
if (ContextCompat.checkSelfPermission(this@MainActivity,
    Manifest.permission.READ_EXTERNAL_STORAGE)
    != PackageManager.PERMISSION_GRANTED) {
    
    ActivityCompat.requestPermissions(this@MainActivity,
        arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
        PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE
} else {
    // start image browsing
    createImageBrowsingRequest()
}
```

{% endtab %}
{% endtabs %}

In order to use [NFC](https://developer.android.com/guide/topics/connectivity/nfc/nfc#manifest), you should include the following permission to the Android Manifest:

```
android.permission.NFC
```
