1# PermissionRequestResult 2 3The **PermissionRequestResult** module defines the result of a permission request. The result is returned when [requestPermissionsFromUser](js-apis-abilityAccessCtrl.md#requestpermissionsfromuser9) is called to request permissions. 4 5> **NOTE** 6> 7> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8> - The APIs of this module can be used only in the stage model. 9 10## Properties 11 12**System capability**: SystemCapability.Security.AccessToken 13 14| Name| Type| Read Only| Optional| Description| 15| -------- | -------- | -------- | -------- | -------- | 16| permissions | Array<string> | Yes| No| Permissions requested.<br> **Atomic service API**: This API can be used in atomic services since API version 11.| 17| authResults | Array<number> | Yes| No| Result of the permission request.<br>- **-1**: The permission is not granted. If **dialogShownResults** is **true**, it is the first time that the user requests the permission. If **dialogShownResults** is **false**, the permission has been set and no dialog box is displayed. The user can modify the permission settings in **Settings**.<br>- **0**: The permission is granted.<br>- **2**: The permission is not granted due to an invalid request. The possible causes are as follows:<br>- The permission is not declared in the configuration file.<br>- The permission name is invalid.<br>- Conditions for requesting the permission are not met. For details, see [ohos.permission.LOCATION](../../security/AccessToken/permissions-for-all.md#ohospermissionlocation) and [ohos.permission.APPROXIMATELY_LOCATION](../../security/AccessToken/permissions-for-all.md#ohospermissionapproximately_location).<br> **Atomic service API**: This API can be used in atomic services since API version 11. | 18| dialogShownResults<sup>12+</sup> | Array<boolean> | Yes| Yes| Whether to display a dialog box.<br>The value **true** means to display a dialog box; the value **false** means the opposite.<br> **Atomic service API**: This API can be used in atomic services since API version 12. | 19 20## Usage 21 22The permission request result is obtained through an **atManager** instance. 23 24**Example** 25 26For details about how to obtain the context in the example, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability). 27 28```ts 29import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; 30import { BusinessError } from '@ohos.base'; 31import common from '@ohos.app.ability.common'; 32 33let atManager = abilityAccessCtrl.createAtManager(); 34try { 35 let context: Context = getContext(this) as common.UIAbilityContext; 36 atManager.requestPermissionsFromUser(context, ["ohos.permission.CAMERA"]).then((data) => { 37 console.info("data:" + JSON.stringify(data)); 38 console.info("data permissions:" + data.permissions); 39 console.info("data authResults:" + data.authResults); 40 console.info("data dialogShownResults:" + data.dialogShownResults); 41 }).catch((err: BusinessError) => { 42 console.error("data:" + JSON.stringify(err)); 43 }) 44} catch(err) { 45 console.error(`catch err->${JSON.stringify(err)}`); 46} 47``` 48