提交 ed1672c6 编写于 作者: L lvyuanyuan

接口一致性问题修改

Signed-off-by: Nlvyuanyuan <lvyuanyuan7@huawei.com>
Change-Id: Iad127639a9baa5c8ef4befc8db31dcdfeb4a47e9
上级 ca03218b
......@@ -14,7 +14,7 @@ import fileShare from '@ohos.fileshare';
## fileShare.grantUriPermission
grantUriPermission(uri: string, bundleName: string, mode: number, callback: AsyncCallback&lt;void&gt;): void
grantUriPermission(uri: string, bundleName: string, flag: wantConstant.Flags, callback: AsyncCallback&lt;void&gt;): void
Grants permissions on a user file by the URI to an application. This API uses an asynchronous callback to return the result.
......@@ -30,7 +30,7 @@ Grants permissions on a user file by the URI to an application. This API uses an
| ------ | ------ | ---- | -------------------------- |
| uri | string | Yes | URI of a user file.|
| bundleName | string | Yes | Bundle name of the application to be grated with the permissions.|
| mode | number | Yes | Permissions to grant. For details, see [wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags).<br>**wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION**: permission to read the file. <br>**wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION**: permission to write the file.|
| flag | wantConstant.Flags | Yes | Permissions to grant. For details, see [wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags).<br>**wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION**: permission to read the file. <br>**wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION**: permission to write the file.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Error codes**
......@@ -67,7 +67,7 @@ try {
## fileShare.grantUriPermission
grantUriPermission(uri: string, bundleName: string, mode: number): Promise&lt;void&gt;
grantUriPermission(uri: string, bundleName: string, flag: wantConstant.Flags): Promise&lt;void&gt;
Grants permissions on a user file by the URI to an application. This API uses a promise to return the result.
......@@ -83,7 +83,7 @@ Grants permissions on a user file by the URI to an application. This API uses a
| ------ | ------ | ---- | -------------------------- |
| uri | string | Yes | URI of a user file.|
| bundleName | string | Yes | Bundle name of the application to be grated with the permissions.|
| mode | number | Yes | Permissions to grant. For details, see [wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags).<br>**wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION**: permission to read the file. <br>**wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION**: permission to write the file.|
| flag | wantConstant.Flags | Yes | Permissions to grant. For details, see [wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags).<br>**wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION**: permission to read the file. <br>**wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION**: permission to write the file.|
**Return value**
......
......@@ -14,7 +14,7 @@ import fileShare from '@ohos.fileshare';
## fileShare.grantUriPermission
grantUriPermission(uri: string, bundleName: string, mode: number, callback: AsyncCallback&lt;void&gt;): void
grantUriPermission(uri: string, bundleName: string, flag: wantConstant.Flags, callback: AsyncCallback&lt;void&gt;): void
对公共目录文件URI进行授权操作,使用callback异步回调。
......@@ -30,7 +30,7 @@ grantUriPermission(uri: string, bundleName: string, mode: number, callback: Asyn
| ------ | ------ | ---- | -------------------------- |
| uri | string | 是 | 公共目录文件URI |
| bundleName | string | 是 | 分享目标的包名 |
| mode | number | 是 | 授权的权限,参考[wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags)<br/>wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION:读授权<br/>wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION:写授权|
| flag | wantConstant.Flags | 是 | 授权的权限,参考[wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags)<br/>wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION:读授权<br/>wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION:写授权|
| callback | AsyncCallback&lt;void&gt; | 是 | 异步授权之后的回调 |
**错误码:**
......@@ -67,7 +67,7 @@ try {
## fileShare.grantUriPermission
grantUriPermission(uri: string, bundleName: string, mode: number): Promise&lt;void&gt;
grantUriPermission(uri: string, bundleName: string, flag: wantConstant.Flags): Promise&lt;void&gt;
将公共目录文件URI进行授权操作,使用Promise异步回调。
......@@ -83,7 +83,7 @@ grantUriPermission(uri: string, bundleName: string, mode: number): Promise&lt;vo
| ------ | ------ | ---- | -------------------------- |
| uri | string | 是 | 公共目录文件URI |
| bundleName | string | 是 | 分享目标的包名 |
| mode | number | 是 | 授权的权限,参考[wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags)<br/>wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION:读授权<br/>wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION:写授权|
| flag | wantConstant.Flags | 是 | 授权的权限,参考[wantConstant.Flags](js-apis-app-ability-wantConstant.md#wantconstantflags)<br/>wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION:读授权<br/>wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION:写授权|
**返回值:**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册