From 5c80caec5edb79756b627569563fe155a2085436 Mon Sep 17 00:00:00 2001 From: dairan Date: Mon, 28 Apr 2025 12:36:01 +0000 Subject: [PATCH 1/3] update api/@ohos.enterprise.restrictions.d.ts. Signed-off-by: dairan --- api/@ohos.enterprise.restrictions.d.ts | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/api/@ohos.enterprise.restrictions.d.ts b/api/@ohos.enterprise.restrictions.d.ts index 6105056880..30d1d42869 100644 --- a/api/@ohos.enterprise.restrictions.d.ts +++ b/api/@ohos.enterprise.restrictions.d.ts @@ -452,6 +452,42 @@ declare namespace restrictions { * @since 14 */ function getDisallowedListForAccount(admin: Want, feature: string, accountId: number): Array; + + /** + * Disallows the settings item 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 } settingsItem - settingsItem indicates the settings item to be disallowed or allowed, + * @param { boolean } disallow - true if disallow the 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. + * @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 settings item 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 } settingsItem indicates the settings item to be disallowed or allowed, + * @param { boolean } disallow - true if disallow the 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. + * @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 + */ + function setUserRestriction(admin: Want, settingsItem: string, disallow: boolean): void; } export default restrictions; -- Gitee From 3ddb8cdb2252d850883e984616a24f29ec593de8 Mon Sep 17 00:00:00 2001 From: dairan Date: Tue, 29 Apr 2025 01:53:05 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0setUserRestriction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dairan --- api/@ohos.enterprise.restrictions.d.ts | 30 ++++++-------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/api/@ohos.enterprise.restrictions.d.ts b/api/@ohos.enterprise.restrictions.d.ts index 30d1d42869..43513df0a1 100644 --- a/api/@ohos.enterprise.restrictions.d.ts +++ b/api/@ohos.enterprise.restrictions.d.ts @@ -454,38 +454,20 @@ declare namespace restrictions { function getDisallowedListForAccount(admin: Want, feature: string, accountId: number): Array; /** - * Disallows the settings item of the device. + * Restricting users from changing specified features on 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 } settingsItem - settingsItem indicates the settings item to be disallowed or allowed, - * @param { boolean } disallow - true if disallow the 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. - * @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 settings item 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 } settingsItem indicates the settings item to be disallowed or allowed, - * @param { boolean } disallow - true if disallow the settings item of device, otherwise false. + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } feature - feature indicates the specific feature to be disallowed. + * @param { boolean } disallow - true if restrict 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. + * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 15 + * @since 18 */ function setUserRestriction(admin: Want, settingsItem: string, disallow: boolean): void; } -- Gitee From 3736b2ef3e6190e95abe8eb9013622850f383efd Mon Sep 17 00:00:00 2001 From: dairan Date: Tue, 29 Apr 2025 06:19:29 +0000 Subject: [PATCH 3/3] update api/@ohos.enterprise.restrictions.d.ts. Signed-off-by: dairan --- api/@ohos.enterprise.restrictions.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.enterprise.restrictions.d.ts b/api/@ohos.enterprise.restrictions.d.ts index 43513df0a1..2089b061a6 100644 --- a/api/@ohos.enterprise.restrictions.d.ts +++ b/api/@ohos.enterprise.restrictions.d.ts @@ -458,7 +458,7 @@ declare namespace restrictions { * * @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 { string } settingsItem - settingsItem indicates the specific feature to be disallowed. * @param { boolean } disallow - true if restrict 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. -- Gitee