未验证 提交 d01c3b7e 编写于 作者: O openharmony_ci 提交者: Gitee

!11747 一致性扫描修改

Merge pull request !11747 from fanchenxuan/master_
......@@ -60,9 +60,10 @@ checkAccessToken(tokenID: number, permissionName: Permissions): Promise<Grant
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
**示例:**
......@@ -106,9 +107,10 @@ verifyAccessTokenSync(tokenID: number, permissionName: Permissions): GrantStatus
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
**示例:**
......@@ -148,12 +150,14 @@ grantUserGrantedPermission(tokenID: number, permissionName: Permissions, permiss
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100002 | TokenId does not exist. |
| 12100003 | Permission does not exist. |
| 12100006 | The specified application does not support the permissions granted or ungranted as specified. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
| 12100002 | The specified tokenID 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. |
| 12100007 | Service is abnormal. |
**示例:**
......@@ -198,9 +202,10 @@ grantUserGrantedPermission(tokenID: number, permissionName: Permissions, permiss
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
| 12100002 | TokenId does not exist. |
| 12100003 | Permission does not exist. |
| 12100006 | The specified application does not support the permissions granted or ungranted as specified. |
......@@ -255,12 +260,14 @@ revokeUserGrantedPermission(tokenID: number, permissionName: Permissions, permis
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100002 | TokenId does not exist. |
| 12100003 | Permission does not exist. |
| 12100006 | The specified application does not support the permissions granted or ungranted as specified. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
| 12100002 | The specified tokenID 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. |
| 12100007 | Service is abnormal. |
**示例:**
......@@ -305,9 +312,10 @@ revokeUserGrantedPermission(tokenID: number, permissionName: Permissions, permis
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
| 12100002 | TokenId does not exist. |
| 12100003 | Permission does not exist. |
| 12100006 | The specified application does not support the permissions granted or ungranted as specified. |
......@@ -361,12 +369,14 @@ getPermissionFlags(tokenID: number, permissionName: Permissions): Promise<num
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100002 | TokenId does not exist. |
| 12100003 | Permission does not exist. |
| 12100006 | The specified application does not support the permissions granted or ungranted as specified. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
| 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. |
| 12100006 | The operation is not allowd. Either the application is a sandbox or the tokenID is from a remote device. |
| 12100007 | Service is abnormal. |
**示例:**
......@@ -430,18 +440,21 @@ on(type: 'permissionStateChange', tokenIDList: Array<number>, permissionNa
| 参数名 | 类型 | 必填 | 说明 |
| ------------------ | --------------------- | ---- | ------------------------------------------------------------ |
| type | string | 是 | 订阅事件类型,固定为'permissionStateChange',权限状态变更事件。 |
| tokenIDList | Array<number> | | 订阅的tokenId列表,为空时表示订阅所有的应用的权限状态变化。 |
| permissionNameList | Array<Permissions> | | 订阅的权限名列表,为空时表示订阅所有的权限状态变化。 |
| tokenIDList | Array<number> | | 订阅的tokenId列表,为空时表示订阅所有的应用的权限状态变化。 |
| permissionNameList | Array<Permissions> | | 订阅的权限名列表,为空时表示订阅所有的权限状态变化。 |
| callback | Callback<[PermissionStateChangeInfo](#permissionstatechangeinfo9)> | 是 | 订阅指定tokenId与指定权限名状态变更事件的回调。|
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100004 | The listener interface is not used together. |
| 12100005 | The number of listeners exceeds the limit. |
| 12100001 | The parameter is invalid. The tokenID is 0 |
| 12100004 | The interface is called repeatedly with the same input. |
| 12100005 | The registration time has exceeded the limitation. |
| 12100007 | Service is abnormal. |
| 12100008 | Out of memory. |
**示例:**
......@@ -450,7 +463,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenIDList: Array<number> = [];
let permissionNameList: Array<Permissions> = [];
let permissionNameList = [];
try {
atManager.on('permissionStateChange', tokenIDList, permissionNameList, (data) => {
console.debug("receive permission state change, data:" + JSON.stringify(data));
......@@ -477,17 +490,20 @@ off(type: 'permissionStateChange', tokenIDList: Array&lt;number&gt;, permissionN
| 参数名 | 类型 | 必填 | 说明 |
| ------------------ | --------------------- | ---- | ------------------------------------------------------------ |
| type | string | 是 | 订阅事件类型,固定为'permissionStateChange',权限状态变更事件。 |
| tokenIDList | Array&lt;number&gt; | | 订阅的tokenId列表,为空时表示订阅所有的应用的权限状态变化,必须与on的输入一致。 |
| permissionNameList | Array&lt;Permissions&gt; | | 订阅的权限名列表,为空时表示订阅所有的权限状态变化,必须与on的输入一致。 |
| tokenIDList | Array&lt;number&gt; | | 订阅的tokenId列表,为空时表示订阅所有的应用的权限状态变化,必须与on的输入一致。 |
| permissionNameList | Array&lt;Permissions&gt; | | 订阅的权限名列表,为空时表示订阅所有的权限状态变化,必须与on的输入一致。 |
| callback | Callback&lt;[PermissionStateChangeInfo](#permissionstatechangeinfo9)&gt; | 否 | 取消订阅指定tokenId与指定权限名状态变更事件的回调。|
**错误码:**
以下错误码的详细介绍请参见[程序访问控制错误码](../errorcodes/errorcode-access-token.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
| 12100001 | Parameter invalid. |
| 12100004 | The listener interface is not used together. |
| 12100001 | The parameter is invalid. The tokenID in list is all invalid |
| 12100004 | The interface is not used with |
| 12100007 | Service is abnormal. |
| 12100008 | Out of memory. |
**示例:**
......@@ -496,7 +512,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenIDList: Array<number> = [];
let permissionNameList: Array<Permissions> = [];
let permissionNameList = [];
try {
atManager.off('permissionStateChange', tokenIDList, permissionNameList);
} catch(err) {
......@@ -582,7 +598,7 @@ promise.then(data => {
**系统能力:** SystemCapability.Security.AccessToken
| 名称 | 默认值 | 描述 |
| 名称 | 值 | 说明 |
| ------------------ | ----- | ----------- |
| PERMISSION_DENIED | -1 | 表示未授权。 |
| PERMISSION_GRANTED | 0 | 表示已授权。 |
......@@ -595,7 +611,7 @@ promise.then(data => {
**系统能力:** SystemCapability.Security.AccessToken
| 名称 | 默认值 | 描述 |
| 名称 | 值 | 说明 |
| ----------------------- | ------ | ----------------- |
| PERMISSION_REVOKED_OPER | 0 | 表示权限取消操作。 |
| PERMISSION_GRANTED_OPER | 1 | 表示权限授予操作。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册