# UserAuthorization

> Use this enum to request permission from the user’s device for access to system features.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public enum UserAuthorization
```

## Remarks

To request permission, pass this as a parameter to [Application.RequestUserAuthorization](/engine/6000.6/script-reference/unityengine/application/requestuserauthorization.md).

## Examples

```csharp
// This script outputs the feed from a video input source (if one exists) to the texture of the GameObject you attach this script to. 
// For this to work, attach this script to a GameObject that has a Renderer component. 

using UnityEngine;
using System.Collections;

public class WebcamExample : MonoBehaviour
{
    private WebCamTexture webCamTexture;

    IEnumerator Start()
    {
        // Request permission from the device for access to video input sources. 
        yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);

        // If the user approves access to video, play video feed to GameObject's texture. 
        if (Application.HasUserAuthorization(UserAuthorization.WebCam))
        {
            // Get the first available video input source.
            string webCamName = WebCamTexture.devices[0].name;
            Debug.Log($"Selected WebCam: {webCamName}");

            // Use this webcam to create a WebCamTexture.
            webCamTexture = new WebCamTexture(webCamName);

            // Assign the texture to the current GameObject. 
            Renderer renderer = GetComponent<Renderer>();
            if (renderer != null)
            {
                renderer.material.mainTexture = webCamTexture;
            }

            // Stream the footage from the webcam. 
            webCamTexture.Play();
        }
        else
        {
            Debug.Log("Webcam not found.");
        }
    }

    void OnApplicationQuit()
    {
        // Stop the webcam feed when the application closes. 
        if (webCamTexture != null && webCamTexture.isPlaying)
        {
            webCamTexture.Stop();
        }
    }
}
```

## Fields

| Value                                                                                     | Description                                                               |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [Microphone](/engine/6000.6/script-reference/unityengine/userauthorization/microphone.md) | Request permission to use any audio input sources attached to the device. |
| [WebCam](/engine/6000.6/script-reference/unityengine/userauthorization/webcam.md)         | Request permission to use any video input sources attached to the device. |
