Grants permission on the file of the specified URI to an application. This API uses an asynchronous callback to return the result.
Grants permission on the file of the specified URI to an application. This API uses an asynchronous callback to return the result.
By default, an application can authorize its own URIs to another application. If the application has the **ohos.permission.PROXY_AUTHORIZATION_URI** permission, there is no such restriction.
**System API**: This is a system API and cannot be called by third-party applications.
@@ -32,26 +37,54 @@ Grants permission on the file of the specified URI to an application. This API u
...
@@ -32,26 +37,54 @@ Grants permission on the file of the specified URI to an application. This API u
| targetBundleName | string | Yes| Bundle name of the application, to which the permission is granted.|
| targetBundleName | string | Yes| Bundle name of the application, to which the permission is granted.|
| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **0** is returned; otherwise, **-1** is returned.|
| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **0** is returned; otherwise, **-1** is returned.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 16000050 | Internal error. |
| 16000058 | Invalid URI flag. |
| 16000059 | Invalid URI type. |
| 16000060 | Sandbox application can not grant URI permission. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
Grants permission on the file of the specified URI to an application. This API uses a promise to return the result.
Grants permission on the file of the specified URI to an application. This API uses a promise to return the result.
By default, an application can authorize its own URIs to another application. If the application has the **ohos.permission.PROXY_AUTHORIZATION_URI** permission, there is no such restriction.
**System API**: This is a system API and cannot be called by third-party applications.
Revokes the permission on the file of the specified URI from an application. This API uses an asynchronous callback to return the result.
Revokes the permission on the file of the specified URI from an application. This API uses an asynchronous callback to return the result.
By default, only the URIs obtained by the application itself or the URIs authorized by the application to other applications can be revoked. If the application has the **ohos.permission.PROXY_AUTHORIZATION_URI** permission, there is no such restriction.
**System API**: This is a system API and cannot be called by third-party applications.
@@ -95,12 +157,23 @@ Revokes the permission on the file of the specified URI from an application. Thi
...
@@ -95,12 +157,23 @@ Revokes the permission on the file of the specified URI from an application. Thi
| targetBundleName | string | Yes| Bundle name of the application, from which the permission is revoked.|
| targetBundleName | string | Yes| Bundle name of the application, from which the permission is revoked.|
| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **0** is returned; otherwise, **-1** is returned.|
| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **0** is returned; otherwise, **-1** is returned.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 16000050 | Internal error. |
| 16000059 | Invalid URI type. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
Revokes the permission on the file of the specified URI from an application. This API uses a promise to return the result.
Revokes the permission on the file of the specified URI from an application. This API uses a promise to return the result.
By default, only the URIs obtained by the application itself or the URIs authorized by the application to other applications can be revoked. If the application has the **ohos.permission.PROXY_AUTHORIZATION_URI** permission, there is no such restriction.
**System API**: This is a system API and cannot be called by third-party applications.