未验证 提交 6be9faa5 编写于 作者: K king_he 提交者: Gitee

update en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md.

Signed-off-by: Nking_he <6384784@qq.com>
上级 38a82978
# Ability Access Control # Ability Access Control
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> > **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -20,9 +20,9 @@ Creates an **AtManager** instance, which is used for ability access control. ...@@ -20,9 +20,9 @@ Creates an **AtManager** instance, which is used for ability access control.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | -------- | -------- |
| [AtManager](#atmanager) | **AtManager** instance obtained.| | [AtManager](#atmanager) | **AtManager** instance obtained. |
**Example** **Example**
...@@ -44,16 +44,16 @@ Checks whether an application has been granted the specified permission. This AP ...@@ -44,16 +44,16 @@ Checks whether an application has been granted the specified permission. This AP
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------- | ---- | ------------------------------------------ | | -------- | ------------------- | ---- | ------------------------------------------ |
| tokenID | number | Yes | ID of the application. | | tokenID | number | Yes | ID of the application. |
| permissionName | string | Yes | Name of the permission to verify.| | permissionName | string | Yes | Name of the permission to verify. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| :------------ | :---------------------------------- | | :------------ | :---------------------------------- |
| Promise&lt;GrantStatus&gt; | Promise instance used to return the result.| | Promise&lt;GrantStatus&gt; | Promise instance used to return the result. |
**Example** **Example**
...@@ -78,17 +78,17 @@ Grants a user granted permission to an application. This API uses a promise to r ...@@ -78,17 +78,17 @@ Grants a user granted permission to an application. This API uses a promise to r
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------- | ---- | ------------------------------------------------------------ | | --------- | ------------------- | ---- | ------------------------------------------------------------ |
| tokenID | number | Yes | ID of the application. | | tokenID | number | Yes | ID of the application. |
| permissionName | string | Yes | Name of the permission to grant.| | permissionName | string | Yes | Name of the permission to grant. |
| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. | | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| :------------ | :---------------------------------- | | :------------ | :---------------------------------- |
| Promise&lt;number&gt; | Promise instance used to return the result.| | Promise&lt;number&gt; | Promise instance used to return the result. |
**Example** **Example**
...@@ -115,12 +115,12 @@ Grants a user granted permission to an application. This API uses an asynchronou ...@@ -115,12 +115,12 @@ Grants a user granted permission to an application. This API uses an asynchronou
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------- | ---- | ------------------------------------------------------------ | | --------- | ------------------- | ---- | ------------------------------------------------------------ |
| tokenID | number | Yes | ID of the application. | | tokenID | number | Yes | ID of the application. |
| permissionName | string | Yes | Name of the permission to grant.| | permissionName | string | Yes | Name of the permission to grant. |
| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. | | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
| callback | AsyncCallback&lt;number&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -145,17 +145,17 @@ Revokes a user granted permission given to an application. This API uses a promi ...@@ -145,17 +145,17 @@ Revokes a user granted permission given to an application. This API uses a promi
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------- | ---- | ------------------------------------------------------------ | | --------- | ------------------- | ---- | ------------------------------------------------------------ |
| tokenID | number | Yes | ID of the application. | | tokenID | number | Yes | ID of the application. |
| permissionName | string | Yes | Name of the permission to revoke.| | permissionName | string | Yes | Name of the permission to revoke. |
| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. | | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| :------------ | :---------------------------------- | | :------------ | :---------------------------------- |
| Promise&lt;number&gt; | Promise instance used to return the result.| | Promise&lt;number&gt; | Promise instance used to return the result. |
**Example** **Example**
...@@ -181,12 +181,12 @@ Revokes a user granted permission given to an application. This API uses an asyn ...@@ -181,12 +181,12 @@ Revokes a user granted permission given to an application. This API uses an asyn
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------- | ---- | ------------------------------------------------------------ | | --------- | ------------------- | ---- | ------------------------------------------------------------ |
| tokenID | number | Yes | ID of the application. | | tokenID | number | Yes | ID of the application. |
| permissionName | string | Yes | Name of the permission to revoke.| | permissionName | string | Yes | Name of the permission to revoke. |
| permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. | | permissionFlag | number | Yes | Permission flag. The value **1** means that a dialog box will still be displayed after the user grants or denies the permission. The value **2** means that no dialog box will be displayed after the user grants or denies the permission. The value **3** means a system permission that cannot be changed. |
| callback | AsyncCallback&lt;number&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -210,16 +210,16 @@ Obtains the flags of the specified permission of a given application. This API u ...@@ -210,16 +210,16 @@ Obtains the flags of the specified permission of a given application. This API u
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------- | ---- | ------------------------------------------------------------ | | --------- | ------------------- | ---- | ------------------------------------------------------------ |
| tokenID | number | Yes | ID of the application. | | tokenID | number | Yes | ID of the application. |
| permissionName | string | Yes | Name of the permission to query.| | permissionName | string | Yes | Name of the permission to query. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| :------------ | :---------------------------------- | | :------------ | :---------------------------------- |
| Promise&lt;number&gt; | Promise instance used to return the result.| | Promise&lt;number&gt; | Promise instance used to return the result. |
**Example** **Example**
...@@ -238,7 +238,7 @@ Enumerates the permission grant states. ...@@ -238,7 +238,7 @@ Enumerates the permission grant states.
**System capability**: SystemCapability.Security.AccessToken **System capability**: SystemCapability.Security.AccessToken
| Name | Default Value | Description | | Name | Default Value | Description |
| ----------------------------- | ---------------------- | ----------------------- | | ----------------------------- | ---------------------- | ----------------------- |
| PERMISSION_DENIED | -1 | Permission denied. | | PERMISSION_DENIED | -1 | Permission denied. |
| PERMISSION_GRANTED | 0 | Permission granted. | | PERMISSION_GRANTED | 0 | Permission granted. |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册