提交 c5682d54 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 729a08cc
...@@ -64,7 +64,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -64,7 +64,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName is greater than 256 bytes. |
**Example** **Example**
...@@ -111,7 +111,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -111,7 +111,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName is greater than 256 bytes. |
**Example** **Example**
...@@ -154,7 +154,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -154,7 +154,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256, or the flags value is invalid. | | 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. | | 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. | | 12100003 | The specified permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. | | 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
...@@ -206,9 +206,9 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -206,9 +206,9 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256, or the flags value is invalid. | | 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. | | 12100002 | TokenId does not exist. |
| 12100003 | The specified permission does not exist. | | 12100003 | Permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. | | 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
| 12100007 | Service is abnormal. | | 12100007 | Service is abnormal. |
...@@ -265,7 +265,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -265,7 +265,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256, or the flags value is invalid. | | 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. | | 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. | | 12100003 | The specified permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be revoked with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. | | 12100006 | The application specified by the tokenID is not allowed to be revoked with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
...@@ -317,9 +317,9 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -317,9 +317,9 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256, or the flags value is invalid. | | 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. | | 12100002 | TokenId does not exist. |
| 12100003 | The specified permission does not exist. | | 12100003 | Permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be revoked with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. | | 12100006 | The application specified by the tokenID is not allowed to be revoked with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
| 12100007 | Service is abnormal. | | 12100007 | Service is abnormal. |
...@@ -375,7 +375,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -375,7 +375,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName is greater than 256 bytes. |
| 12100002 | The specified tokenID does not exist. | | 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. | | 12100003 | The specified permission does not exist. |
| 12100006 | The operation is not allowed. Either the application is a sandbox or the tokenID is from a remote device. | | 12100006 | The operation is not allowed. Either the application is a sandbox or the tokenID is from a remote device. |
...@@ -452,7 +452,7 @@ For details about the error codes, see [Application Access Control Error Codes]( ...@@ -452,7 +452,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message| | ID| Error Message|
| -------- | -------- | | -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256. | | 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName is greater than 256 bytes. |
| 12100004 | The interface is called repeatedly with the same input. | | 12100004 | The interface is called repeatedly with the same input. |
| 12100005 | The registration time has exceeded the limitation. | | 12100005 | The registration time has exceeded the limitation. |
| 12100007 | Service is abnormal. | | 12100007 | Service is abnormal. |
...@@ -693,44 +693,6 @@ promise.then(data => { ...@@ -693,44 +693,6 @@ promise.then(data => {
}); });
``` ```
### checkAccessTokenSync<sup>10+</sup>
checkAccessTokenSync(tokenID: number, permissionName: Permissions): GrantStatus;
Checks whether a permission is granted to an application. This API returns the result synchronously.
**System capability**: SystemCapability.Security.AccessToken
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------- | ---- | ------------------------------------------ |
| tokenID | number | Yes | Token ID of the application. The value can be obtained from [ApplicationInfo](js-apis-bundleManager-applicationInfo.md). |
| permissionName | Permissions | Yes | Permission to check. For details about the permissions, see the [Application Permission List](../../security/permission-list.md).|
**Return value**
| Type | Description |
| :------------ | :---------------------------------- |
| [GrantStatus](#grantstatus) | Permission grant state.|
**Error codes**
For details about the error codes, see [Application Access Control Error Codes](../errorcodes/errorcode-access-token.md).
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, or the string size of permissionName is larger than 256. |
**Example**
```js
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let data = atManager.checkAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
console.log(`data->${JSON.stringify(data)}`);
```
### GrantStatus ### GrantStatus
Enumerates the permission grant states. Enumerates the permission grant states.
...@@ -757,7 +719,7 @@ Enumerates the operations that trigger permission grant state changes. ...@@ -757,7 +719,7 @@ Enumerates the operations that trigger permission grant state changes.
### PermissionStateChangeInfo<sup>9+</sup> ### PermissionStateChangeInfo<sup>9+</sup>
Defines information about the permission grant state change. Defines detailed information about the permission grant state change.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -768,3 +730,4 @@ Defines information about the permission grant state change. ...@@ -768,3 +730,4 @@ Defines information about the permission grant state change.
| change | [PermissionStateChangeType](#permissionstatechangetype9) | Yes | No | Operation that triggers the permission grant state change. | | change | [PermissionStateChangeType](#permissionstatechangetype9) | Yes | No | Operation that triggers the permission grant state change. |
| tokenID | number | Yes | No | Token ID of the application. | | tokenID | number | Yes | No | Token ID of the application. |
| permissionName | Permissions | Yes | No | Permission whose grant state changes. For details about the permissions, see the [Application Permission List](../../security/permission-list.md). | | permissionName | Permissions | Yes | No | Permission whose grant state changes. For details about the permissions, see the [Application Permission List](../../security/permission-list.md). |
...@@ -22,8 +22,7 @@ Obtains the total size (in bytes) of the specified volume in an external storage ...@@ -22,8 +22,7 @@ Obtains the total size (in bytes) of the specified volume in an external storage
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -59,8 +58,7 @@ Obtains the total size (in bytes) of the specified volume in an external storage ...@@ -59,8 +58,7 @@ Obtains the total size (in bytes) of the specified volume in an external storage
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -90,8 +88,7 @@ Obtains the available space (in bytes) of the specified volume in an external st ...@@ -90,8 +88,7 @@ Obtains the available space (in bytes) of the specified volume in an external st
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -128,8 +125,7 @@ Obtains the available space (in bytes) of the specified volume in an external st ...@@ -128,8 +125,7 @@ Obtains the available space (in bytes) of the specified volume in an external st
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -159,8 +155,7 @@ Obtains the space (in bytes) of an application. This API uses a promise to retur ...@@ -159,8 +155,7 @@ Obtains the space (in bytes) of an application. This API uses a promise to retur
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -196,8 +191,7 @@ Obtains the space (in bytes) of an application. This API uses an asynchronous ca ...@@ -196,8 +191,7 @@ Obtains the space (in bytes) of an application. This API uses an asynchronous ca
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -263,12 +257,8 @@ Obtains the space (in bytes) of this third-party application. This API uses an a ...@@ -263,12 +257,8 @@ Obtains the space (in bytes) of this third-party application. This API uses an a
## BundleStats<sup>9+</sup> ## BundleStats<sup>9+</sup>
### Attributes
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| --------- | ------ | --- | ---- | -------------- | | --------- | ------ | --- | ---- | -------------- |
| appSize | number | Yes| No| Size of the application, in bytes. | | appSize | number | Yes| No| Size of the application, in bytes. |
...@@ -286,9 +276,7 @@ Obtains the total size (in bytes) of the built-in storage. This API uses a promi ...@@ -286,9 +276,7 @@ Obtains the total size (in bytes) of the built-in storage. This API uses a promi
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Return value** **Return value**
...@@ -313,9 +301,7 @@ Obtains the total size (in bytes) of the built-in storage. This API uses an asyn ...@@ -313,9 +301,7 @@ Obtains the total size (in bytes) of the built-in storage. This API uses an asyn
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -343,9 +329,7 @@ Obtains the available space (in bytes) of the built-in storage. This API uses a ...@@ -343,9 +329,7 @@ Obtains the available space (in bytes) of the built-in storage. This API uses a
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Return value** **Return value**
...@@ -371,9 +355,7 @@ Obtains the available space (in bytes) of the built-in storage. This API uses an ...@@ -371,9 +355,7 @@ Obtains the available space (in bytes) of the built-in storage. This API uses an
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -400,8 +382,7 @@ Obtains the system data space, in bytes. This API uses a promise to return the r ...@@ -400,8 +382,7 @@ Obtains the system data space, in bytes. This API uses a promise to return the r
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Return value** **Return value**
...@@ -430,9 +411,7 @@ Obtains the system data space, in bytes. This API uses an asynchronous callback ...@@ -430,9 +411,7 @@ Obtains the system data space, in bytes. This API uses an asynchronous callback
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -459,9 +438,7 @@ Obtains the storage statistics (in bytes) of this user. This API uses a promise ...@@ -459,9 +438,7 @@ Obtains the storage statistics (in bytes) of this user. This API uses a promise
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Return value** **Return value**
...@@ -489,9 +466,7 @@ Obtains the storage statistics (in bytes) of this user. This API uses an asynchr ...@@ -489,9 +466,7 @@ Obtains the storage statistics (in bytes) of this user. This API uses an asynchr
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -515,9 +490,7 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a ...@@ -515,9 +490,7 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -552,9 +525,7 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a ...@@ -552,9 +525,7 @@ Obtains the storage statistics (in bytes) of the specified user. This API uses a
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
**Parameters** **Parameters**
...@@ -576,12 +547,9 @@ This is a system API. ...@@ -576,12 +547,9 @@ This is a system API.
## StorageStats<sup>9+</sup> ## StorageStats<sup>9+</sup>
### Attributes
**System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics
**System API**: This is a system API.
This is a system API.
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| --------- | ------ | ---- | ----- | -------------- | | --------- | ------ | ---- | ----- | -------------- |
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
> **NOTE** > **NOTE**
> >
> - The initial APIs of this module are supported since API version 3. 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 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>- The APIs provided by this module are deprecated since API version 9. You are advised to use [cryptoFramework-Cipher](js-apis-cryptoFramework.md#Cipher). >- The APIs provided by this module are deprecated since API version 9. You are advised to use [@ohos.security.cryptoFramework Cipher](js-apis-cryptoFramework.md#cipher).
## Modules to Import ## Modules to Import
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册