1e41f4b71Sopenharmony_ci# PermissionRequestResult 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **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. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> - 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. 8e41f4b71Sopenharmony_ci> - The APIs of this module can be used only in the stage model. 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci## Attributes 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Security.AccessToken 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci| Name| Type| Read Only| Optional| Description| 15e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- | 16e41f4b71Sopenharmony_ci| permissions | Array<string> | Yes| No| Permissions requested.<br> **Atomic service API**: This API can be used in atomic services since API version 11.| 17e41f4b71Sopenharmony_ci| authResults | Array<number> | Yes| No| Result of the permission request.<br>- **-1**: The permission is not authorized and must be set in **Settings** without displaying a dialog box.<br>- **0**: The permission is authorized.<br>- **2**: The permission is not authorized 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> - Certain conditions are not met when the permission is applied. 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.| 18e41f4b71Sopenharmony_ci| dialogShownResults<sup>12+</sup> | Array<boolean> | Yes| Yes| Whether to display a dialog box.<br>The value **true** means to display a dialog box;<br>the value **false** means the opposite.<br> **Atomic service API**: This API can be used in atomic services since API version 12.| 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci## Usage 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ciThe permission request result is obtained through an **atManager** instance. 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci**Example** 25e41f4b71Sopenharmony_ciFor 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). 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci```ts 28e41f4b71Sopenharmony_ciimport abilityAccessCtrl from '@ohos.abilityAccessCtrl'; 29e41f4b71Sopenharmony_ciimport { BusinessError } from '@ohos.base'; 30e41f4b71Sopenharmony_ciimport common from '@ohos.app.ability.common'; 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_cilet atManager = abilityAccessCtrl.createAtManager(); 33e41f4b71Sopenharmony_citry { 34e41f4b71Sopenharmony_ci let context: Context = getContext(this) as common.UIAbilityContext; 35e41f4b71Sopenharmony_ci atManager.requestPermissionsFromUser(context, ["ohos.permission.CAMERA"]).then((data) => { 36e41f4b71Sopenharmony_ci console.info("data:" + JSON.stringify(data)); 37e41f4b71Sopenharmony_ci console.info("data permissions:" + data.permissions); 38e41f4b71Sopenharmony_ci console.info("data authResults:" + data.authResults); 39e41f4b71Sopenharmony_ci console.info("data dialogShownResults:" + data.dialogShownResults); 40e41f4b71Sopenharmony_ci }).catch((err: BusinessError) => { 41e41f4b71Sopenharmony_ci console.error("data:" + JSON.stringify(err)); 42e41f4b71Sopenharmony_ci }) 43e41f4b71Sopenharmony_ci} catch(err) { 44e41f4b71Sopenharmony_ci console.error(`catch err->${JSON.stringify(err)}`); 45e41f4b71Sopenharmony_ci} 46e41f4b71Sopenharmony_ci``` 47