From a68ebd8988ae96cd708dd7c352385562b76a2c98 Mon Sep 17 00:00:00 2001 From: HYY Date: Thu, 19 Jun 2025 10:50:41 +0800 Subject: [PATCH] add setdelegated polcies Signed-off-by: HYY --- api/@ohos.enterprise.adminManager.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api/@ohos.enterprise.adminManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts index 3919e784a8..89374a1fc1 100644 --- a/api/@ohos.enterprise.adminManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -804,6 +804,23 @@ declare namespace adminManager { * @since 18 */ function replaceSuperAdmin(oldAdmin: Want, newAdmin: Want, isKeepPolicy: boolean): void; + + /** + * Administrator delegates access to policies to another application. + * + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { string } bundleName - bundleName indicates the bundle name of the delegated application. + * @param { Array } policies - policies indicates the policies accessible to the delegated application. + * @param { number } userId - userId indicates the user ID. + * @throws { BusinessError } 9200009 - Failed to grant the permission to the application. + * @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. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 20 + */ + function setDelegatedPolicies(bundleName: string, policies: Array, userId: number): void; } export default adminManager; -- Gitee