1# @ohos.enterprise.restrictions (Restrictions) (System API) 2 3This **restrictions** module provides APIs for setting general restriction policies, including disabling or enabling the printer and OpenHarmony Device Connector (hdc) for devices. 4 5> **NOTE** 6> 7> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8> 9> - The APIs of this module can be used only in the stage model. 10> 11> - The APIs of this module can be called only by a [device administrator application](../../mdm/mdm-kit-guide.md#introduction) that is [enabled](js-apis-enterprise-adminManager-sys.md#adminmanagerenableadmin-2). 12> 13> - This topic describes only the system APIs provided by the module. For details about its public APIs, see [@ohos.enterprise.restrictions](js-apis-enterprise-restrictions.md). 14 15## Modules to Import 16 17```ts 18import { restrictions } from '@kit.MDMKit'; 19``` 20 21## restrictions.setPrinterDisabled 22 23setPrinterDisabled(admin: Want, disabled: boolean, callback: AsyncCallback\<void>): void 24 25Enables or disables the printing capability of the device. This API uses an asynchronous callback to return the result. 26 27**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 28 29**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 30 31**Parameters** 32 33| Name | Type | Mandatory | Description | 34| ----- | ----------------------------------- | ---- | ------- | 35| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 36| disabled | boolean | Yes| Operation to perform. The value **true** means to disable the printer; the value **false** means the opposite.| 37| callback | AsyncCallback\<void> | Yes| Callback invoked to return the result. <br>If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 38 39**Error codes** 40 41For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 42 43| ID| Error Message | 44| ------- | ---------------------------------------------------------------------------- | 45| 9200001 | The application is not an administrator application of the device. | 46| 9200002 | The administrator application does not have permission to manage the device. | 47| 201 | Permission verification failed. The application does not have the permission required to call the API. | 48| 202 | Permission verification failed. A non-system application calls a system API. | 49| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 50 51**Example** 52 53```ts 54import { Want } from '@kit.AbilityKit'; 55 56let wantTemp: Want = { 57 bundleName: 'com.example.myapplication', 58 abilityName: 'EntryAbility', 59}; 60 61restrictions.setPrinterDisabled(wantTemp, true, (err) => { 62 if (err) { 63 console.error(`Failed to set printer disabled. Code is ${err.code}, message is ${err.message}`); 64 return; 65 } 66 console.info('Succeeded in setting printer disabled'); 67}) 68``` 69 70## restrictions.setPrinterDisabled 71 72setPrinterDisabled(admin: Want, disabled: boolean): Promise\<void> 73 74Enables or disables the printing capability of the device. This API uses a promise to return the result. 75 76**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 77 78**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 79 80**Parameters** 81 82| Name | Type | Mandatory | Description | 83| ----- | ----------------------------------- | ---- | ------- | 84| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 85| disabled | boolean | Yes| Operation to perform. The value **true** means to disable the printer; the value **false** means the opposite.| 86 87**Return value** 88 89| Type | Description | 90| ----- | ----------------------------------- | 91| Promise\<void> | Promise that returns no value. An error object is thrown when the print capability fails to be disabled or enabled.| 92 93**Error codes** 94 95For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 96 97| ID| Error Message | 98| ------- | ---------------------------------------------------------------------------- | 99| 9200001 | The application is not an administrator application of the device. | 100| 9200002 | The administrator application does not have permission to manage the device. | 101| 201 | Permission verification failed. The application does not have the permission required to call the API. | 102| 202 | Permission verification failed. A non-system application calls a system API. | 103| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 104 105**Example** 106 107```ts 108import { Want } from '@kit.AbilityKit'; 109import { BusinessError } from '@kit.BasicServicesKit'; 110 111let wantTemp: Want = { 112 bundleName: 'com.example.myapplication', 113 abilityName: 'EntryAbility', 114}; 115 116restrictions.setPrinterDisabled(wantTemp, true).then(() => { 117 console.info('Succeeded in setting printer disabled'); 118}).catch((err: BusinessError) => { 119 console.error(`Failed to set printer disabled. Code is ${err.code}, message is ${err.message}`); 120}) 121``` 122 123## restrictions.isPrinterDisabled 124 125isPrinterDisabled(admin: Want, callback: AsyncCallback\<boolean>): void 126 127Queries whether the printing capability of a device is disabled. This API uses an asynchronous callback to return the result. 128 129**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 130 131**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 132 133**Parameters** 134 135| Name | Type | Mandatory | Description | 136| ----- | ----------------------------------- | ---- | ------- | 137| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 138| callback | AsyncCallback\<boolean> | Yes| Callback invoked to return the result.<br>The value **true** means that the printer is disabled; the value **false** means the opposite.| 139 140**Error codes** 141 142For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 143 144| ID| Error Message | 145| ------- | ---------------------------------------------------------------------------- | 146| 9200001 | The application is not an administrator application of the device. | 147| 9200002 | The administrator application does not have permission to manage the device. | 148| 201 | Permission verification failed. The application does not have the permission required to call the API. | 149| 202 | Permission verification failed. A non-system application calls a system API. | 150| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 151 152**Example** 153 154```ts 155import { Want } from '@kit.AbilityKit'; 156 157let wantTemp: Want = { 158 bundleName: 'com.example.myapplication', 159 abilityName: 'EntryAbility', 160}; 161 162restrictions.isPrinterDisabled(wantTemp, (err, result) => { 163 if (err) { 164 console.error(`Failed to query is the printing function disabled or not. Code is ${err.code}, message is ${err.message}`); 165 return; 166 } 167 console.info(`Succeeded in querying is the printing function disabled : ${result}`); 168}) 169``` 170 171## restrictions.isPrinterDisabled 172 173isPrinterDisabled(admin: Want): Promise\<boolean> 174 175Queries whether the printing capability of a device is disabled. This API uses a promise to return the result. 176 177**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 178 179**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 180 181**Parameters** 182 183| Name| Type | Mandatory| Description | 184| ------ | ------------------------------------------------------- | ---- | -------------------------------------- | 185| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 186 187**Return value** 188 189| Type | Description | 190| ----- | ----------------------------------- | 191| Promise\<boolean> | Promise used to return the result. The value **true** means that the printer is disabled; the value **false** means the opposite.| 192 193**Error codes** 194 195For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 196 197| ID| Error Message | 198| ------- | ---------------------------------------------------------------------------- | 199| 9200001 | The application is not an administrator application of the device. | 200| 9200002 | The administrator application does not have permission to manage the device. | 201| 201 | Permission verification failed. The application does not have the permission required to call the API. | 202| 202 | Permission verification failed. A non-system application calls a system API. | 203| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 204 205**Example** 206 207```ts 208import { Want } from '@kit.AbilityKit'; 209import { BusinessError } from '@kit.BasicServicesKit'; 210 211let wantTemp: Want = { 212 bundleName: 'com.example.myapplication', 213 abilityName: 'EntryAbility', 214}; 215 216restrictions.isPrinterDisabled(wantTemp).then((result) => { 217 console.info(`Succeeded in querying is the printing function disabled : ${result}`); 218}).catch((err: BusinessError) => { 219 console.error(`Failed to query is the printing function disabled or not. Code is ${err.code}, message is ${err.message}`); 220}) 221``` 222 223## restrictions.setHdcDisabled 224 225setHdcDisabled(admin: Want, disabled: boolean, callback: AsyncCallback\<void>): void 226 227Enables or disables [HDC](../../../device-dev/subsystems/subsys-toolchain-hdc-guide.md#hdc). This API uses an asynchronous callback to return the result. 228 229**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 230 231**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 232 233**Parameters** 234 235| Name | Type | Mandatory | Description | 236| ----- | ----------------------------------- | ---- | ------- | 237| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 238| disabled | boolean | Yes| Operation to perform. The value **true** means to disable HDC; the value **false** means the opposite.| 239| callback | AsyncCallback\<void> | Yes| Callback invoked to return the result. <br>If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 240 241**Error codes** 242 243For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 244 245| ID| Error Message | 246| ------- | ---------------------------------------------------------------------------- | 247| 9200001 | The application is not an administrator application of the device. | 248| 9200002 | The administrator application does not have permission to manage the device. | 249| 201 | Permission verification failed. The application does not have the permission required to call the API. | 250| 202 | Permission verification failed. A non-system application calls a system API. | 251| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 252 253**Example** 254 255```ts 256import { Want } from '@kit.AbilityKit'; 257 258let wantTemp: Want = { 259 bundleName: 'com.example.myapplication', 260 abilityName: 'EntryAbility', 261}; 262 263restrictions.setHdcDisabled(wantTemp, true, (err) => { 264 if (err) { 265 console.error(`Failed to set hdc disabled. Code is ${err.code}, message is ${err.message}`); 266 return; 267 } 268 console.info('Succeeded in setting hdc disabled'); 269}) 270``` 271 272## restrictions.setHdcDisabled 273 274setHdcDisabled(admin: Want, disabled: boolean): Promise\<void> 275 276Enables or disables HDC on a device. This API uses a promise to return the result. 277 278**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 279 280**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 281 282**Parameters** 283 284| Name | Type | Mandatory | Description | 285| ----- | ----------------------------------- | ---- | ------- | 286| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 287| disabled | boolean | Yes| Operation to perform. The value **true** means to disable HDC; the value **false** means the opposite.| 288 289**Return value** 290 291| Type | Description | 292| ----- | ----------------------------------- | 293| Promise\<void> | Promise that returns no value. An error object is thrown when the HDC fails to be disabled or enabled.| 294 295**Error codes** 296 297For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 298 299| ID| Error Message | 300| ------- | ---------------------------------------------------------------------------- | 301| 9200001 | The application is not an administrator application of the device. | 302| 9200002 | The administrator application does not have permission to manage the device. | 303| 201 | Permission verification failed. The application does not have the permission required to call the API. | 304| 202 | Permission verification failed. A non-system application calls a system API. | 305| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 306 307**Example** 308 309```ts 310import { Want } from '@kit.AbilityKit'; 311import { BusinessError } from '@kit.BasicServicesKit'; 312 313let wantTemp: Want = { 314 bundleName: 'com.example.myapplication', 315 abilityName: 'EntryAbility', 316}; 317 318restrictions.setHdcDisabled(wantTemp, true).then(() => { 319 console.info('Succeeded in setting hdc disabled'); 320}).catch((err: BusinessError) => { 321 console.error(`Failed to set hdc disabled. Code is ${err.code}, message is ${err.message}`); 322}) 323``` 324 325## restrictions.isHdcDisabled 326 327isHdcDisabled(admin: Want, callback: AsyncCallback\<boolean>): void 328 329Queries whether HDC is disabled. This API uses an asynchronous callback to return the result. 330 331**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 332 333**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 334 335**Parameters** 336 337| Name | Type | Mandatory | Description | 338| ----- | ----------------------------------- | ---- | ------- | 339| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 340| callback | AsyncCallback\<boolean> | Yes| Callback invoked to return the result.<br>The value **true** means HDC is disabled; the value **false** means the opposite.| 341 342**Error codes** 343 344For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 345 346| ID| Error Message | 347| ------- | ---------------------------------------------------------------------------- | 348| 9200001 | The application is not an administrator application of the device. | 349| 9200002 | The administrator application does not have permission to manage the device. | 350| 201 | Permission verification failed. The application does not have the permission required to call the API. | 351| 202 | Permission verification failed. A non-system application calls a system API. | 352| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 353 354**Example** 355 356```ts 357import { Want } from '@kit.AbilityKit'; 358 359let wantTemp: Want = { 360 bundleName: 'com.example.myapplication', 361 abilityName: 'EntryAbility', 362}; 363 364restrictions.isHdcDisabled(wantTemp, (err, result) => { 365 if (err) { 366 console.error(`Failed to query is hdc disabled or not. Code is ${err.code}, message is ${err.message}`); 367 return; 368 } 369 console.info(`Succeeded in querying is hdc disabled : ${result}`); 370}) 371``` 372 373## restrictions.isHdcDisabled 374 375isHdcDisabled(admin: Want): Promise\<boolean> 376 377Queries whether HDC is disabled. This API uses a promise to return the result. 378 379**Required permissions**: ohos.permission.ENTERPRISE_RESTRICT_POLICY 380 381**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 382 383**Parameters** 384 385| Name| Type | Mandatory| Description | 386| ------ | ------------------------------------------------------- | ---- | -------------------------------------- | 387| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 388 389**Return value** 390 391| Type | Description | 392| ----- | ----------------------------------- | 393| Promise\<boolean> | Promise used to return the result. The value **true** means HDC is disabled; the value **false** means the opposite.| 394 395**Error codes** 396 397For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 398 399| ID| Error Message | 400| ------- | ---------------------------------------------------------------------------- | 401| 9200001 | The application is not an administrator application of the device. | 402| 9200002 | The administrator application does not have permission to manage the device. | 403| 201 | Permission verification failed. The application does not have the permission required to call the API. | 404| 202 | Permission verification failed. A non-system application calls a system API. | 405| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 406 407**Example** 408 409```ts 410import { Want } from '@kit.AbilityKit'; 411import { BusinessError } from '@kit.BasicServicesKit'; 412 413let wantTemp: Want = { 414 bundleName: 'com.example.myapplication', 415 abilityName: 'EntryAbility', 416}; 417 418restrictions.isHdcDisabled(wantTemp).then((result) => { 419 console.info(`Succeeded in querying is hdc disabled : ${result}`); 420}).catch((err: BusinessError) => { 421 console.error(`Failed to query is hdc disabled or not. Code is ${err.code}, message is ${err.message}`); 422}) 423``` 424 425## restrictions.isMicrophoneDisabled<sup>11+</sup> 426 427isMicrophoneDisabled(admin: Want): boolean 428 429Queries whether the microphone is disabled. 430 431**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 432 433**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 434 435**Parameters** 436 437| Name| Type | Mandatory| Description | 438| ------ | ------------------------------------------------------- | ---- | -------------------------------------- | 439| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 440 441**Return value** 442 443| Type | Description | 444| ----- | ----------------------------------- | 445| boolean | Returns **true** if the microphone is disabled; returns **false** otherwise.| 446 447**Error codes** 448 449For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 450 451| ID| Error Message | 452| ------- | ---------------------------------------------------------------------------- | 453| 9200001 | The application is not an administrator application of the device. | 454| 9200002 | The administrator application does not have permission to manage the device. | 455| 201 | Permission verification failed. The application does not have the permission required to call the API. | 456| 202 | Permission verification failed. A non-system application calls a system API. | 457| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 458 459**Example** 460 461```ts 462import { Want } from '@kit.AbilityKit'; 463 464let wantTemp: Want = { 465 bundleName: 'com.example.myapplication', 466 abilityName: 'EntryAbility', 467}; 468 469try { 470 let result = restrictions.isMicrophoneDisabled(wantTemp); 471 console.info(`Succeeded in querying is microphone disabled : ${result}`); 472} catch (err) { 473 console.error(`Failed to query is microphone disabled or not. Code is ${err.code}, message is ${err.message}`); 474} 475``` 476 477## restrictions.disableMicrophone<sup>11+</sup> 478 479disableMicrophone(admin: Want, disable: boolean): void 480 481Enables or disables the microphone. 482 483**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 484 485**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 486 487**Parameters** 488 489| Name | Type | Mandatory | Description | 490| ----- | ----------------------------------- | ---- | ------- | 491| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 492| disable | boolean | Yes| Operation to perform. The value **true** means to disable the microphone; the value **false** means the opposite.| 493 494**Error codes** 495 496For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 497 498| ID| Error Message | 499| ------- | ---------------------------------------------------------------------------- | 500| 9200001 | The application is not an administrator application of the device. | 501| 9200002 | The administrator application does not have permission to manage the device. | 502| 201 | Permission verification failed. The application does not have the permission required to call the API. | 503| 202 | Permission verification failed. A non-system application calls a system API. | 504| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 505 506**Example** 507 508```ts 509import { Want } from '@kit.AbilityKit'; 510import { BusinessError } from '@kit.BasicServicesKit'; 511 512let wantTemp: Want = { 513 bundleName: 'com.example.myapplication', 514 abilityName: 'EntryAbility', 515}; 516 517try { 518 restrictions.disableMicrophone(wantTemp, true); 519 console.info('Succeeded in setting microphone disabled'); 520} catch (err) { 521 console.error(`Failed to disable microphone. Code is ${err.code}, message is ${err.message}`); 522} 523``` 524 525## restrictions.setFingerprintAuthDisabled<sup>11+</sup> 526 527setFingerprintAuthDisabled(admin: Want, disabled: boolean): void 528 529Enables or disables fingerprint authentication. 530 531**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 532 533**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 534 535**Parameters** 536 537| Name | Type | Mandatory | Description | 538| ----- | ----------------------------------- | ---- | ------- | 539| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 540| disabled | boolean | Yes| Operation to perform. The value **true** means to disable fingerprint authentication; the value **false** the opposite.| 541 542**Error codes** 543 544For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 545 546| ID| Error Message | 547| ------- | ---------------------------------------------------------------------------- | 548| 9200001 | The application is not an administrator application of the device. | 549| 9200002 | The administrator application does not have permission to manage the device. | 550| 201 | Permission verification failed. The application does not have the permission required to call the API. | 551| 202 | Permission verification failed. A non-system application calls a system API. | 552| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 553 554**Example** 555 556```ts 557import { Want } from '@kit.AbilityKit'; 558 559let wantTemp: Want = { 560 bundleName: 'com.example.myapplication', 561 abilityName: 'EntryAbility', 562}; 563 564try { 565 restrictions.setFingerprintAuthDisabled(wantTemp, true); 566 console.info('Succeeded in disabling the fingerprint auth'); 567} catch (err) { 568 console.error(`Failed to disable fingerprint auth. Code: ${err.code}, message: ${err.message}`); 569}; 570 571``` 572 573## restrictions.isFingerprintAuthDisabled<sup>11+</sup> 574 575isFingerprintAuthDisabled(admin: Want): boolean 576 577Queries whether fingerprint authentication is disabled. 578 579**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 580 581**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 582 583**Parameters** 584 585| Name| Type | Mandatory| Description | 586| ------ | ------------------------------------------------------- | ---- | -------------------------------------- | 587| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | EnterpriseAdminExtensionAbility.| 588 589**Return value** 590 591| Type | Description | 592| ----- | ----------------------------------- | 593| boolean | Returns **true** if fingerprint authentication is disabled; returns **false** otherwise.| 594 595**Error codes** 596 597For details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 598 599| ID| Error Message | 600| ------- | ---------------------------------------------------------------------------- | 601| 9200001 | The application is not an administrator application of the device. | 602| 9200002 | The administrator application does not have permission to manage the device. | 603| 201 | Permission verification failed. The application does not have the permission required to call the API. | 604| 202 | Permission verification failed. A non-system application calls a system API. | 605| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 606 607**Example** 608 609```ts 610import { Want } from '@kit.AbilityKit'; 611 612let wantTemp: Want = { 613 bundleName: 'com.example.myapplication', 614 abilityName: 'EntryAbility', 615}; 616 617try { 618 let result: boolean = restrictions.isFingerprintAuthDisabled(wantTemp); 619 console.info(`Succeeded in getting the state of fingerprint auth. result : ${result}`); 620} catch (err) { 621 console.error(`Failed to get the state of fingerprint auth. Code: ${err.code}, message: ${err.message}`); 622}; 623``` 624