当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
46 Star 180 Fork 4.8K

OpenHarmony/interface_sdk-js
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.enterprise.restrictions.d.ts 40.12 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
/*
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit MDMKit
*/
import type { AsyncCallback } from '@ohos.base';
import type Want from '@ohos.app.ability.Want';
/**
* This module provides the capability to manage restriction policy of the enterprise devices.
*
* @namespace restrictions
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @since 10
*/
declare namespace restrictions {
/**
* Disable or enable the printing function of the device
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { boolean } disabled - true if the user disables the printing function.
* @param { AsyncCallback<void> } callback - the callback of setPrinterDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function setPrinterDisabled(admin: Want, disabled: boolean, callback: AsyncCallback<void>): void;
/**
* Disable or enable the printing function of the device
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { boolean } disabled - true if the user disables the printing function.
* @returns { Promise<void> } the promise returned by the setPrinterDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function setPrinterDisabled(admin: Want, disabled: boolean): Promise<void>;
/**
* Is the printing function of the device disabled
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @param { AsyncCallback<boolean> } callback - the callback of isPrinterDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function isPrinterDisabled(admin: Want, callback: AsyncCallback<boolean>): void;
/**
* Is the printing function of the device disabled
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @returns { Promise<boolean> } the promise returned by the isPrinterDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function isPrinterDisabled(admin: Want): Promise<boolean>;
/**
* Disable or enable the HDC function of the device
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { boolean } disabled - true if the user disables the HDC function.
* @param { AsyncCallback<void> } callback - the callback of setHdcDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function setHdcDisabled(admin: Want, disabled: boolean, callback: AsyncCallback<void>): void;
/**
* Disable or enable the HDC function of the device
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { boolean } disabled - true if the user disables the HDC function.
* @returns { Promise<void> } the promise returned by the setHdcDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function setHdcDisabled(admin: Want, disabled: boolean): Promise<void>;
/**
* Is the HDC function of the device disabled
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @param { AsyncCallback<boolean> } callback - the callback of isHdcDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function isHdcDisabled(admin: Want, callback: AsyncCallback<boolean>): void;
/**
* Is the HDC function of the device disabled
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @returns { Promise<boolean> } the promise returned by the isHdcDisabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function isHdcDisabled(admin: Want): Promise<boolean>;
/**
* Disables the microphone of device.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { boolean } disable - true if disable the microphone of device, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function disableMicrophone(admin: Want, disable: boolean): void;
/**
* Queries whether the microphone of device is disabled.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @returns { boolean } true if the microphone of device is disabled, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function isMicrophoneDisabled(admin: Want): boolean;
/**
* Sets the device fingerprint authorization capability disabled.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { boolean } disabled - true if set the fingerprint authorization capability disabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function setFingerprintAuthDisabled(admin: Want, disabled: boolean): void;
/**
* Queries device fingerprint authorization capability is disabled or enabled.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @returns { boolean } true if the fingerprint authorization capability is disabled.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function isFingerprintAuthDisabled(admin: Want): boolean;
/**
* Disallows the specific feature of the device.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be disallowed or allowed,
* the supported device features include modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb and wifi.
* @param { boolean } disallow - true if disallow the specific feature of device, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
/**
* Disallows the specific feature of the device.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be disallowed or allowed,
* the supported device features include modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb and wifi.
* @param { boolean } disallow - true if disallow the specific feature of device, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 15
*/
/**
* Disallows the specific feature of the device.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be disallowed or allowed,
* the supported device features are as follows:
* modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb, wifi, tethering, inactiveUserFreeze, camera, mtpClient, mtpServer,
* globalDrag, externalSdCard, backupAndRestore, notification, mms, sms, remoteDiagnosis, remoteDesk, nfc, privateSpace, vpn, airplaneMode,
* mobileData, maintenanceMode, sambaClient, sambaServer.
* @param { boolean } disallow - true if disallow the specific feature of device, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
/**
* Disallows the specific feature of the device.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be disallowed or allowed,
* the supported device features are as follows:
* modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb, wifi, tethering, inactiveUserFreeze, camera,
* mtpClient, mtpServer, globalDrag, externalSdCard, backupAndRestore, notification, mms, sms, remoteDiagnosis, remoteDesk,
* nfc, privateSpace, vpn, airplaneMode, mobileData, maintenanceMode, sambaClient, sambaServer, appClone,
* externalStorageCard, randomMac.
* @param { boolean } disallow - true if disallow the specific feature of device, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 9200013 - The enterprise management policy has been successfully set, but the function has not taken effect in real time.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 21
*/
function setDisallowedPolicy(admin: Want, feature: string, disallow: boolean): void;
/**
* Queries whether the specific feature of the device is disallowed.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be queried,
* the supported device features include modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb and wifi.
* @returns { boolean } true if the specific feature of device is disallowed, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
/**
* Queries whether the specific feature of the device is disallowed.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be queried,
* the supported device features include modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb and wifi.
* @returns { boolean } true if the specific feature of device is disallowed, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 15
*/
/**
* Queries whether the specific feature of the device is disallowed.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS
* @param { Want | null } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be queried,
* the supported device features are as follows:
* modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb, wifi, tethering, inactiveUserFreeze, camera, mtpClient, mtpServer,
* globalDrag, externalSdCard, backupAndRestore, notification, mms, sms, remoteDiagnosis, remoteDesk, nfc, privateSpace, vpn, airplaneMode,
* mobileData, maintenanceMode, sambaClient, sambaServer.
* @returns { boolean } true if the specific feature of device is disallowed, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
/**
* Queries whether the specific feature of the device is disallowed.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS
* @param { Want | null } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @param { string } feature - feature indicates the specific feature to be queried,
* the supported device features are as follows:
* modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb, wifi, tethering, inactiveUserFreeze, camera,
* mtpClient, mtpServer, globalDrag, externalSdCard, backupAndRestore, notification, mms, sms, remoteDiagnosis, remoteDesk,
* nfc, privateSpace, vpn, airplaneMode, mobileData, maintenanceMode, sambaClient, sambaServer, appClone, externalStorageCard,
* randomMac.
* @returns { boolean } true if the specific feature of device is disallowed, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 21
*/
function getDisallowedPolicy(admin: Want | null, feature: string): boolean;
/**
* Disallows the specific feature of the device for the specified account.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* @param { string } feature - feature indicates the specific feature to be disallowed or allowed.
* @param { boolean } disallow - true if disallow the specific feature of device, otherwise false.
* @param { number } accountId - accountId indicates the account ID to be queried.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 9200010 - A conflict policy has been configured.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 14
*/
/**
* Disallows the specific feature of the device for the specified account.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* @param { string } feature - feature indicates the specific feature to be disallowed or allowed,
* the supported device features are as follows:
* fingerprint, print, mtpClient, usbStorageDeviceWrite, diskRecoveryKey, sudo, distributedTransmissionOutgoing.
* @param { boolean } disallow - true if disallow the specific feature of device, otherwise false.
* @param { number } accountId - accountId indicates the account ID to be queried.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 9200010 - A conflict policy has been configured.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
function setDisallowedPolicyForAccount(admin: Want, feature: string, disallow: boolean, accountId: number): void;
/**
* Queries whether the specific feature of the device is disallowed for the specified account.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* @param { string } feature - feature indicates the specific feature to be queried.
* @param { number } accountId - accountId indicates the account ID to be queried.
* @returns { boolean } true if the specific feature of device is disallowed, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 14
*/
/**
* Queries whether the specific feature of the device is disallowed for the specified account.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want | null } admin - admin indicates the enterprise admin extension ability information.
* @param { string } feature - feature indicates the specific feature to be queried.
* the supported device features are as follows:
* fingerprint, print, mtpClient, usbStorageDeviceWrite, diskRecoveryKey, sudo, distributedTransmissionOutgoing.
* @param { number } accountId - accountId indicates the account ID to be queried.
* @returns { boolean } true if the specific feature of device is disallowed, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
function getDisallowedPolicyForAccount(admin: Want | null, feature: string, accountId: number): boolean;
/**
* Adds applications or bundles or other contents to the list to restrict them from using a specific feature.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the administrator ability information.
* @param { string } feature - feature indicates the specific feature to be disallowed.
* @param { Array<string> } list - list of restricted applications or bundles or other contents.
* @param { number } accountId - indicates the account ID.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 14
*/
function addDisallowedListForAccount(admin: Want, feature: string, list: Array<string>, accountId: number): void;
/**
* Removes applications or bundles or other contents from the list to unblock them from using a specific feature.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the administrator ability information.
* @param { string } feature - feature indicates the specific feature to be disallowed.
* @param { Array<string> } list - list of unblock applications or bundles or other contents.
* @param { number } accountId - indicates the account ID.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 14
*/
function removeDisallowedListForAccount(admin: Want, feature: string, list: Array<string>, accountId: number): void;
/**
* Gets the list of applications or bundles or other contents that are restrict from using a specific feature.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS
* @param { Want } admin - admin indicates the administrator ability information.
* @param { string } feature - feature indicates the specific feature to be disallowed.
* @param { number } accountId - indicates the account ID.
* @returns { Array<string> } list - list of applications or bundles or other contents.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 14
*/
function getDisallowedListForAccount(admin: Want, feature: string, accountId: number): Array<string>;
/**
* Restricting users from changing specified settings item on the device.
*
* @permission ohos.permission.ENTERPRISE_SET_USER_RESTRICTION
* @param { Want } admin - admin indicates the administrator ability information.
* @param { string } settingsItem - settingsItem indicates the specific settings item to be disallowed.
* the supported settingsItems are as follows:
* setEthernetIp, setApn, powerKeyShutdown, setDeviceName,
* setBiometricsAndScreenLock.
* @param { boolean } restricted - true if restrict the specific settings item of device, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
function setUserRestriction(admin: Want, settingsItem: string, restricted: boolean): void;
/**
* Gets whether users are restricted from changing specified settings items on the device.
*
* @permission ohos.permission.ENTERPRISE_SET_USER_RESTRICTION
* @param { Want } admin - admin indicates the administrator ability information.
* @param { string } settingsItem - settingsItem indicates the specific settings item to be disallowed.
* @returns { boolean } true if restrict the specific settings item of device, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
function getUserRestricted(admin: Want, settingsItem: string): boolean;
}
export default restrictions;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助