Selaa lähdekoodia

Merge pull request #11693 from RussWhitehead/noUser

HPCC-20515 Toaster message when starting eclwatch

Reviewed-By: Kevin Wang <kevin.wang@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 vuotta sitten
vanhempi
commit
7211d80287
1 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 6 3
      esp/services/ws_account/ws_accountService.cpp

+ 6 - 3
esp/services/ws_account/ws_accountService.cpp

@@ -151,10 +151,13 @@ bool Cws_accountEx::onMyAccount(IEspContext &context, IEspMyAccountRequest &req,
     try
     {
         ISecUser* userInContext = context.queryUser();
-        if (!userInContext)
-            throw MakeStringException(ECLWATCH_INVALID_SEC_MANAGER, "User not set in EspContext");
-
         CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(context.querySecManager());
+        if (!userInContext)
+        {
+            if (secmgr || (context.getDomainAuthType() == AuthUserNameOnly))
+                throw MakeStringException(ECLWATCH_INVALID_SEC_MANAGER, "User not set in EspContext");
+            return true;
+        }
         if (!secmgr)
         {
             resp.setUsername(userInContext->getName());