diff --git a/sa_profile/useriam.cfg b/sa_profile/useriam.cfg index 0954d0d9f..0e7c6c99b 100644 --- a/sa_profile/useriam.cfg +++ b/sa_profile/useriam.cfg @@ -19,7 +19,9 @@ "ohos.permission.ACCESS_SERVICE_DM", "ohos.permission.sec.ACCESS_UDID", "ohos.permission.MANAGE_SECURE_SETTINGS", - "ohos.permission.PERMISSION_USED_STATS" + "ohos.permission.PERMISSION_USED_STATS", + "ohos.permission.MANAGE_USER_IDM", + "ohos.permission.USE_USER_IDM" ], "permission_acls" : [ "ohos.permission.ACCESS_AUTH_RESPOOL", diff --git a/services/core/src/publish_event_adapter.cpp b/services/core/src/publish_event_adapter.cpp index f81ea00ee..9fb49afbc 100644 --- a/services/core/src/publish_event_adapter.cpp +++ b/services/core/src/publish_event_adapter.cpp @@ -32,10 +32,14 @@ const std::string USER_PIN_CREATED_EVENT = "USER_PIN_CREATED_EVENT"; const std::string USER_PIN_DELETED_EVENT = "USER_PIN_DELETED_EVENT"; const std::string USER_PIN_UPDATED_EVENT = "USER_PIN_UPDATED_EVENT"; const std::string USER_CREDENTIAL_UPDATED_EVENT = "USER_CREDENTIAL_UPDATED_EVENT"; +const std::string USERIAM_COMMON_EVENT_PERMISSION = "ohos.permission.USE_USER_IDM"; void PublishEvent(EventFwk::CommonEventData data) { EventFwk::CommonEventPublishInfo publishInfo; + std::vector permissions; + permissions.push_back(USERIAM_COMMON_EVENT_PERMISSION); + publishInfo.SetSubscriberPermissions(permissions); publishInfo.SetSticky(false); if (!EventFwk::CommonEventManager::PublishCommonEvent(data, publishInfo)) { IAM_LOGE("PublishCommonEvent failed, eventAction is %{public}s", data.GetWant().GetAction().c_str());