From 7b3cfa1468aedeb553596c16d90b0b1848b8417f Mon Sep 17 00:00:00 2001 From: haixiangw Date: Thu, 9 Jan 2025 18:32:08 -0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=89=E8=B5=B7openCertificateManagerDialog?= =?UTF-8?q?=E6=97=A0=E6=9D=83=E9=99=90=E6=97=B6=EF=BC=8C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: haixiangw --- .../innerkits/cert_manager_standard/main/include/cm_type.h | 1 + interfaces/kits/napi/src/dialog/cm_napi_dialog_common.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/interfaces/innerkits/cert_manager_standard/main/include/cm_type.h b/interfaces/innerkits/cert_manager_standard/main/include/cm_type.h index 879de12..e90eac8 100644 --- a/interfaces/innerkits/cert_manager_standard/main/include/cm_type.h +++ b/interfaces/innerkits/cert_manager_standard/main/include/cm_type.h @@ -173,6 +173,7 @@ enum CMDialogErrorCode { CMR_DIALOG_ERROR_SA_INTERNAL_ERROR = -1007, CMR_DIALOG_ERROR_NOT_EXIST = -1008, CMR_DIALOG_ERROR_NOT_SUPPORTED = -1009, + CMR_DIALOG_ERROR_PERMISSION_DENIED = 1011, /* UIExtension will return 1011 if permission check failed */ }; enum CMErrorCode { /* temp use */ diff --git a/interfaces/kits/napi/src/dialog/cm_napi_dialog_common.cpp b/interfaces/kits/napi/src/dialog/cm_napi_dialog_common.cpp index 9b082bb..0fbf940 100644 --- a/interfaces/kits/napi/src/dialog/cm_napi_dialog_common.cpp +++ b/interfaces/kits/napi/src/dialog/cm_napi_dialog_common.cpp @@ -63,6 +63,8 @@ static const std::string NOT_ENTERPRISE_DEVICE_MSG = "The operation does not com "such as the device does not allow users to manage the ca certificate of the global user."; static const std::unordered_map DIALOG_CODE_TO_JS_CODE_MAP = { + // no permission + { CMR_DIALOG_ERROR_PERMISSION_DENIED, HAS_NO_PERMISSION }, // internal error { CMR_DIALOG_ERROR_INTERNAL, DIALOG_ERROR_GENERIC }, // the user cancels the installation operation @@ -82,6 +84,7 @@ static const std::unordered_map DIALOG_CODE_TO_JS_CODE_MAP = { }; static const std::unordered_map DIALOG_CODE_TO_MSG_MAP = { + { CMR_DIALOG_ERROR_PERMISSION_DENIED, DIALOG_NO_PERMISSION_MSG }, { CMR_DIALOG_ERROR_INTERNAL, DIALOG_GENERIC_MSG }, { CMR_DIALOG_ERROR_OPERATION_CANCELS, DIALOG_OPERATION_CANCELS_MSG }, { CMR_DIALOG_ERROR_INSTALL_FAILED, DIALOG_INSTALL_FAILED_MSG }, -- Gitee