otsdaq  v2_04_01
CorePropertySupervisorBase.cc
1 #include "otsdaq-core/CoreSupervisors/CorePropertySupervisorBase.h"
2 
3 using namespace ots;
4 
6  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES =
8 
9 //========================================================================================================================
10 CorePropertySupervisorBase::CorePropertySupervisorBase(xdaq::Application* application)
11  : theConfigurationManager_(0) // new ConfigurationManager)
12  , supervisorClass_(application->getApplicationDescriptor()->getClassName())
13  , supervisorClassNoNamespace_(supervisorClass_.substr(
14  supervisorClass_.find_last_of(":") + 1,
15  supervisorClass_.length() - supervisorClass_.find_last_of(":")))
16  , supervisorContextUID_(
17  "UNINITIALIZED_supervisorContextUID") // MUST BE INITIALIZED
18  // INSIDE THE CONTRUCTOR
19  // TO THROW EXCEPTIONS
20  // on bad conditions
21  , supervisorApplicationUID_(
22  "UNINITIALIZED_supervisorApplicationUID") // MUST BE INITIALIZED INSIDE THE
23  // CONTRUCTOR TO THROW EXCEPTIONS on
24  // bad conditions
25  , supervisorConfigurationPath_(
26  "UNINITIALIZED_supervisorConfigurationPath") // MUST BE INITIALIZED INSIDE THE
27  // CONTRUCTOR TO THROW EXCEPTIONS
28  // on bad conditions
29  , propertiesAreSetup_(false)
30 {
31  INIT_MF("CorePropertySupervisorBase");
32 
33  __SUP_COUTV__(application->getApplicationContext()->getContextDescriptor()->getURL());
34  __SUP_COUTV__(application->getApplicationDescriptor()->getLocalId());
35  __SUP_COUTV__(supervisorClass_);
36  __SUP_COUTV__(supervisorClassNoNamespace_);
37 
38  // get all supervisor info, and wiz mode, macroMaker mode, or not
39  allSupervisorInfo_.init(application->getApplicationContext());
40 
41  if(allSupervisorInfo_.isMacroMakerMode())
42  {
43  theConfigurationManager_ = new ConfigurationManager(false /*initForWriteAccess*/,
44  true /*initializeFromFhicl*/);
45  __SUP_COUT__
46  << "Macro Maker mode detected. So skipping configuration location work for "
47  "supervisor of class '"
48  << supervisorClass_ << "'" << __E__;
49 
50  supervisorContextUID_ = "MacroMakerFEContext";
51  supervisorApplicationUID_ = "MacroMakerFESupervisor";
52  supervisorConfigurationPath_ =
53  CorePropertySupervisorBase::supervisorContextUID_ +
54  "/LinkToApplicationTable/" +
55  CorePropertySupervisorBase::supervisorApplicationUID_ +
56  "/LinkToSupervisorTable";
57 
58  __SUP_COUTV__(CorePropertySupervisorBase::supervisorContextUID_);
59  __SUP_COUTV__(CorePropertySupervisorBase::supervisorApplicationUID_);
60  __SUP_COUTV__(CorePropertySupervisorBase::supervisorConfigurationPath_);
61 
62  CorePropertySupervisorBase::indicateOtsAlive(0);
63 
64  return;
65  }
66  else if(allSupervisorInfo_.isWizardMode())
67  {
68  __SUP_COUT__ << "Wiz mode detected. So skipping configuration location work for "
69  "supervisor of class '"
70  << supervisorClass_ << "'" << __E__;
71  supervisorContextUID_ = "NO CONTEXT ID IN WIZ MODE";
72  supervisorApplicationUID_ =
73  std::to_string(application->getApplicationDescriptor()->getLocalId());
74  supervisorConfigurationPath_ = "NO APP PATH IN WIZ MODE";
75 
76  __SUP_COUTV__(CorePropertySupervisorBase::supervisorContextUID_);
77  __SUP_COUTV__(CorePropertySupervisorBase::supervisorApplicationUID_);
78  __SUP_COUTV__(CorePropertySupervisorBase::supervisorConfigurationPath_);
79 
80  return;
81  }
82 
83  __SUP_COUT__ << "Getting configuration specific info for supervisor '"
84  << (allSupervisorInfo_.getSupervisorInfo(application).getName())
85  << "' of class " << supervisorClass_ << "." << __E__;
86 
87  // get configuration specific info for the application supervisor
88 
89  try
90  {
91  theConfigurationManager_ = new ConfigurationManager();
92  CorePropertySupervisorBase::supervisorContextUID_ =
93  theConfigurationManager_->__GET_CONFIG__(XDAQContextTable)
94  ->getContextUID(application->getApplicationContext()
95  ->getContextDescriptor()
96  ->getURL());
97  }
98  catch(...)
99  {
100  __SUP_COUT_ERR__
101  << "XDAQ Supervisor could not access it's configuration through "
102  "the Configuration Manager."
103  << ". The getApplicationContext()->getContextDescriptor()->getURL() = "
104  << application->getApplicationContext()->getContextDescriptor()->getURL()
105  << __E__;
106  throw;
107  }
108 
109  try
110  {
111  CorePropertySupervisorBase::supervisorApplicationUID_ =
112  theConfigurationManager_->__GET_CONFIG__(XDAQContextTable)
113  ->getApplicationUID(
114  application->getApplicationContext()
115  ->getContextDescriptor()
116  ->getURL(),
117  application->getApplicationDescriptor()->getLocalId());
118  }
119  catch(...)
120  {
121  __SUP_COUT_ERR__ << "XDAQ Supervisor could not access it's configuration through "
122  "the Configuration Manager."
123  << " The supervisorContextUID_ = " << supervisorContextUID_
124  << ". The supervisorApplicationUID = "
125  << supervisorApplicationUID_ << __E__;
126  throw;
127  }
128 
129  CorePropertySupervisorBase::supervisorConfigurationPath_ =
130  "/" + CorePropertySupervisorBase::supervisorContextUID_ +
131  "/LinkToApplicationTable/" +
132  CorePropertySupervisorBase::supervisorApplicationUID_ + "/LinkToSupervisorTable";
133 
134  __SUP_COUTV__(CorePropertySupervisorBase::supervisorContextUID_);
135  __SUP_COUTV__(CorePropertySupervisorBase::supervisorApplicationUID_);
136  __SUP_COUTV__(CorePropertySupervisorBase::supervisorConfigurationPath_);
137 
138  CorePropertySupervisorBase::indicateOtsAlive(this);
139 
140  theConfigurationManager_->setOwnerContext(
141  CorePropertySupervisorBase::supervisorContextUID_);
142  theConfigurationManager_->setOwnerApp(
143  CorePropertySupervisorBase::supervisorApplicationUID_);
144 
145 } // end constructor
146 
147 //========================================================================================================================
148 CorePropertySupervisorBase::~CorePropertySupervisorBase(void)
149 {
150  if(theConfigurationManager_)
151  delete theConfigurationManager_;
152 } // end destructor
153 
154 //========================================================================================================================
155 void CorePropertySupervisorBase::indicateOtsAlive(
156  const CorePropertySupervisorBase* properties)
157 {
158  char portStr[100] = "0";
159  std::string hostname = "wiz";
160 
161  // Note: the environment variable __ENV__("HOSTNAME") fails in multinode ots systems
162  // started through ssh
163 
164  if(properties)
165  {
166  unsigned int port = properties->getContextTreeNode()
167  .getNode(properties->supervisorContextUID_)
168  .getNode("Port")
169  .getValue<unsigned int>();
170  sprintf(portStr, "%u", port);
171 
172  hostname = properties->getContextTreeNode()
173  .getNode(properties->supervisorContextUID_)
174  .getNode("Address")
175  .getValue<std::string>();
176 
177  size_t i = hostname.find("//");
178  if(i != std::string::npos)
179  hostname = hostname.substr(i + 2);
180 
181  __COUTV__(hostname);
182  }
183 
184  // indicate ots is alive (for StartOTS.sh to verify launch was successful)
185  std::string filename = std::string(__ENV__("OTSDAQ_LOG_DIR")) + "/otsdaq_is_alive-" +
186  hostname + "-" + portStr + ".dat";
187  FILE* fp = fopen(filename.c_str(), "w");
188  if(!fp)
189  {
190  __SS__ << "Failed to open the ots-is-alive file: " << filename << __E__;
191  __SS_THROW__;
192  }
193  fprintf(fp, "%s %s %ld\n", hostname.c_str(), portStr, time(0));
194  fclose(fp);
195 
196  __COUT__ << "Marked alive: " << filename << __E__;
197 }
198 
199 //========================================================================================================================
200 // When overriding, setup default property values here
201 // called by CorePropertySupervisorBase constructor before loading user defined property
202 // values
203 void CorePropertySupervisorBase::setSupervisorPropertyDefaults(void)
204 {
205  // This can be done in the constructor because when you start xdaq it loads the
206  // configuration that can't be changed while running!
207 
208  //__SUP_COUT__ << "Setting up Core Supervisor Base property defaults for supervisor"
209  //<<
210  // "..." << __E__;
211 
212  // set core Supervisor base class defaults
213  CorePropertySupervisorBase::setSupervisorProperty(
214  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserPermissionsThreshold,
215  "*=1");
216  CorePropertySupervisorBase::setSupervisorProperty(
217  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserGroupsAllowed, "");
218  CorePropertySupervisorBase::setSupervisorProperty(
219  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserGroupsDisallowed, "");
220 
221  CorePropertySupervisorBase::setSupervisorProperty(
222  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.CheckUserLockRequestTypes, "");
223  CorePropertySupervisorBase::setSupervisorProperty(
224  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.RequireUserLockRequestTypes,
225  "");
226  CorePropertySupervisorBase::setSupervisorProperty(
227  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.AutomatedRequestTypes, "");
228  CorePropertySupervisorBase::setSupervisorProperty(
229  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.AllowNoLoginRequestTypes, "");
230 
231  CorePropertySupervisorBase::setSupervisorProperty(
232  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.NoXmlWhiteSpaceRequestTypes,
233  "");
234  CorePropertySupervisorBase::setSupervisorProperty(
235  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.NonXMLRequestTypes, "");
236 
237  // __SUP_COUT__ << "Done setting up Core Supervisor Base property defaults for
238  // supervisor" <<
239  // "..." << __E__;
240 }
241 
242 //========================================================================================================================
243 // extractPermissionsMapFromString
244 // Static function that extract map function to standardize approach
245 // in case needed by supervisors for special permissions handling.
246 // For example, used to serve Desktop Icons.
247 //
248 // permissionsString format is as follows:
249 // <groupName>:<permissionsThreshold> pairs separated by ',' '&' or '|'
250 // for example, to give access admins and pixel team but not calorimeter team:
251 // allUsers:255 | pixelTeam:1 | calorimeterTeam:0
252 //
253 // Use with CorePropertySupervisorBase::doPermissionsGrantAccess to determine
254 // if access is allowed.
255 void CorePropertySupervisorBase::extractPermissionsMapFromString(
256  const std::string& permissionsString,
257  std::map<std::string, WebUsers::permissionLevel_t>& permissionsMap)
258 {
259  permissionsMap.clear();
260  StringMacros::getMapFromString(permissionsString, permissionsMap);
261 }
262 
263 //========================================================================================================================
264 // doPermissionsGrantAccess
265 // Static function that checks permissionLevelsMap against permissionThresholdsMap and
266 // returns true if access requirements are met.
267 //
268 // This is useful in standardizing approach for supervisors in case of
269 // of special permissions handling.
270 // For example, used to serve Desktop Icons.
271 //
272 // permissionLevelsString format is as follows:
273 // <groupName>:<permissionsLevel> pairs separated by ',' '&' or '|'
274 // for example, to be a standard user and an admin on the pixel team and no access to
275 // calorimeter team: allUsers:1 | pixelTeam:255 | calorimeterTeam:0
276 //
277 // permissionThresoldsString format is as follows:
278 // <groupName>:<permissionsThreshold> pairs separated by ',' '&' or '|'
279 // for example, to give access admins and pixel team but not calorimeter team:
280 // allUsers:255 | pixelTeam:1 | calorimeterTeam:0
281 bool CorePropertySupervisorBase::doPermissionsGrantAccess(
282  std::map<std::string, WebUsers::permissionLevel_t>& permissionLevelsMap,
283  std::map<std::string, WebUsers::permissionLevel_t>& permissionThresholdsMap)
284 {
285  // return true if a permission level group name is found with a permission level
286  // greater than or equal to the permission level at a matching group name entry in
287  // the thresholds map.
288 
289  //__COUTV__(StringMacros::mapToString(permissionLevelsMap));
290  //__COUTV__(StringMacros::mapToString(permissionThresholdsMap));
291 
292  for(const auto& permissionLevelGroupPair : permissionLevelsMap)
293  {
294  //__COUTV__(permissionLevelGroupPair.first);
295  //__COUTV__(permissionLevelGroupPair.second);
296 
297  for(const auto& permissionThresholdGroupPair : permissionThresholdsMap)
298  {
299  //__COUTV__(permissionThresholdGroupPair.first);
300  //__COUTV__(permissionThresholdGroupPair.second);
301  if(permissionLevelGroupPair.first == permissionThresholdGroupPair.first &&
302  permissionThresholdGroupPair.second && // not explicitly disallowed
303  permissionLevelGroupPair.second >= permissionThresholdGroupPair.second)
304  return true; // access granted!
305  }
306  }
307  //__COUT__ << "Denied." << __E__;
308 
309  // if here, no access group match found
310  // so denied
311  return false;
312 } // end doPermissionsGrantAccess
313 
314 //========================================================================================================================
315 void CorePropertySupervisorBase::checkSupervisorPropertySetup()
316 {
317  if(propertiesAreSetup_)
318  return;
319 
320  // Immediately mark properties as setup, (prevent infinite loops due to
321  // other launches from within this function, e.g. from getSupervisorProperty)
322  // only redo if Context configuration group changes
323  propertiesAreSetup_ = true;
324 
325  CorePropertySupervisorBase::setSupervisorPropertyDefaults(); // calls base class
326  // version defaults
327 
328  //__SUP_COUT__ << "Setting up supervisor specific property DEFAULTS for supervisor..."
329  //<< __E__;
330  setSupervisorPropertyDefaults(); // calls override version defaults
331  // __SUP_COUT__ << "Done setting up supervisor
332  // specific property DEFAULTS for supervisor" <<
333  // "." << __E__;
334 
335  if(allSupervisorInfo_.isWizardMode())
336  __SUP_COUT__ << "Wiz mode detected. Skipping setup of supervisor properties for "
337  "supervisor of class '"
338  << supervisorClass_ << "'" << __E__;
339  else if(allSupervisorInfo_.isMacroMakerMode())
340  __SUP_COUT__
341  << "Maker Maker mode detected. Skipping setup of supervisor properties for "
342  "supervisor of class '"
343  << supervisorClass_ << "'" << __E__;
344  else
345  CorePropertySupervisorBase::loadUserSupervisorProperties(); // loads user
346  // settings from
347  // configuration
348 
349  //__SUP_COUT__ << "Setting up supervisor specific FORCED properties for supervisor..."
350  //<< __E__;
351  forceSupervisorPropertyValues(); // calls override forced values
352  // __SUP_COUT__ << "Done setting up supervisor
353  // specific FORCED properties for supervisor" <<
354  // "." << __E__;
355 
356  CorePropertySupervisorBase::extractPermissionsMapFromString(
357  getSupervisorProperty(
358  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserPermissionsThreshold),
359  propertyStruct_.UserPermissionsThreshold);
360 
361  propertyStruct_.UserGroupsAllowed.clear();
362  StringMacros::getMapFromString(
363  getSupervisorProperty(
364  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserGroupsAllowed),
365  propertyStruct_.UserGroupsAllowed);
366 
367  propertyStruct_.UserGroupsDisallowed.clear();
368  StringMacros::getMapFromString(
369  getSupervisorProperty(
370  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserGroupsDisallowed),
371  propertyStruct_.UserGroupsDisallowed);
372 
373  auto nameIt = SUPERVISOR_PROPERTIES.allSetNames_.begin();
374  auto setIt = propertyStruct_.allSets_.begin();
375  while(nameIt != SUPERVISOR_PROPERTIES.allSetNames_.end() &&
376  setIt != propertyStruct_.allSets_.end())
377  {
378  (*setIt)->clear();
379  StringMacros::getSetFromString(getSupervisorProperty(*(*nameIt)), *(*setIt));
380 
381  ++nameIt;
382  ++setIt;
383  }
384 
385  __SUP_COUT__ << "Final supervisor property settings:" << __E__;
386  for(auto& property : propertyMap_)
387  __SUP_COUT__ << "\t" << property.first << " = " << property.second << __E__;
388 }
389 
390 //========================================================================================================================
391 // getSupervisorTreeNode ~
392 // try to get this Supervisors configuration tree node
393 ConfigurationTree CorePropertySupervisorBase::getSupervisorTreeNode(void) try
394 {
395  if(supervisorContextUID_ == "" || supervisorApplicationUID_ == "")
396  {
397  __SUP_SS__ << "Empty supervisorContextUID_ or supervisorApplicationUID_."
398  << __E__;
399  __SUP_SS_THROW__;
400  }
401  return theConfigurationManager_->getSupervisorNode(supervisorContextUID_,
402  supervisorApplicationUID_);
403 }
404 catch(...)
405 {
406  __SUP_COUT_ERR__
407  << "XDAQ Supervisor could not access it's configuration node through "
408  "theConfigurationManager_ "
409  << "(Did you remember to initialize using CorePropertySupervisorBase::init()?)."
410  << " The supervisorContextUID_ = " << supervisorContextUID_
411  << ". The supervisorApplicationUID = " << supervisorApplicationUID_ << __E__;
412  throw;
413 }
414 
415 //========================================================================================================================
416 // loadUserSupervisorProperties ~
417 // try to get user supervisor properties
418 void CorePropertySupervisorBase::loadUserSupervisorProperties(void)
419 {
420  // __SUP_COUT__ << "Loading user properties for supervisor '" <<
421  // supervisorContextUID_ << "/" << supervisorApplicationUID_ <<
422  // "'..." << __E__;
423 
424  // re-acquire the configuration supervisor node, in case the config has changed
425  auto supervisorNode = CorePropertySupervisorBase::getSupervisorTreeNode();
426 
427  try
428  {
429  auto /*map<name,node>*/ children =
430  supervisorNode.getNode("LinkToPropertyTable").getChildren();
431 
432  for(auto& child : children)
433  {
434  if(child.second.getNode("Status").getValue<bool>() == false)
435  continue; // skip OFF properties
436 
437  auto propertyName = child.second.getNode("PropertyName").getValue();
438  setSupervisorProperty(
439  propertyName,
440  child.second.getNode("PropertyValue").getValue<std::string>());
441  }
442  }
443  catch(...)
444  {
445  __SUP_COUT__ << "No user supervisor property settings found in the configuration "
446  "tree, going with the defaults."
447  << __E__;
448  }
449 
450  // __SUP_COUT__ << "Done loading user properties for supervisor '" <<
451  // supervisorContextUID_ << "/" << supervisorApplicationUID_ <<
452  // "'" << __E__;
453 }
454 
455 //========================================================================================================================
456 void CorePropertySupervisorBase::setSupervisorProperty(const std::string& propertyName,
457  const std::string& propertyValue)
458 {
459  propertyMap_[propertyName] = propertyValue;
460  // __SUP_COUT__ << "Set propertyMap_[" << propertyName <<
461  // "] = " << propertyMap_[propertyName] << __E__;
462 }
463 
464 //========================================================================================================================
465 void CorePropertySupervisorBase::addSupervisorProperty(const std::string& propertyName,
466  const std::string& propertyValue)
467 {
468  propertyMap_[propertyName] =
469  propertyValue + " | " + getSupervisorProperty(propertyName);
470  // __SUP_COUT__ << "Set propertyMap_[" << propertyName <<
471  // "] = " << propertyMap_[propertyName] << __E__;
472 }
473 
474 //========================================================================================================================
475 // getSupervisorProperty
476 // string version of template function
477 std::string CorePropertySupervisorBase::getSupervisorProperty(
478  const std::string& propertyName)
479 {
480  // check if need to setup properties
481  checkSupervisorPropertySetup();
482 
483  auto it = propertyMap_.find(propertyName);
484  if(it == propertyMap_.end())
485  {
486  __SUP_SS__ << "Could not find property named " << propertyName << __E__;
487  __SS_THROW__; //__SUP_SS_THROW__;
488  }
489  return StringMacros::validateValueForDefaultStringDataType(it->second);
490 }
491 
492 //========================================================================================================================
493 // getSupervisorPropertyUserPermissionsThreshold
494 // returns the threshold based on the requestType
495 WebUsers::permissionLevel_t
496 CorePropertySupervisorBase::getSupervisorPropertyUserPermissionsThreshold(
497  const std::string& requestType)
498 {
499  // check if need to setup properties
500  checkSupervisorPropertySetup();
501 
502  return StringMacros::getWildCardMatchFromMap(
503  requestType, propertyStruct_.UserPermissionsThreshold);
504 
505  // auto it = propertyStruct_.UserPermissionsThreshold.find(requestType);
506  // if(it == propertyStruct_.UserPermissionsThreshold.end())
507  // {
508  // __SUP_SS__ << "Could not find requestType named " << requestType << " in
509  // UserPermissionsThreshold map." << __E__;
510  // __SS_THROW__; //__SUP_SS_THROW__;
511  // }
512  // return it->second;
513 }
514 
515 //========================================================================================================================
516 // getRequestUserInfo ~
517 // extract user info for request based on property configuration
518 void CorePropertySupervisorBase::getRequestUserInfo(WebUsers::RequestUserInfo& userInfo)
519 {
520  checkSupervisorPropertySetup();
521 
522  //__SUP_COUT__ << "userInfo.requestType_ " << userInfo.requestType_ << " files: " <<
523  // cgiIn.getFiles().size() << __E__;
524 
525  userInfo.automatedCommand_ = StringMacros::inWildCardSet(
526  userInfo.requestType_,
527  propertyStruct_.AutomatedRequestTypes); // automatic commands should not refresh
528  // cookie code.. only user initiated
529  // commands should!
530  userInfo.NonXMLRequestType_ = StringMacros::inWildCardSet(
531  userInfo.requestType_, propertyStruct_.NonXMLRequestTypes); // non-xml request
532  // types just return
533  // the request return
534  // string to client
535  userInfo.NoXmlWhiteSpace_ = StringMacros::inWildCardSet(
536  userInfo.requestType_, propertyStruct_.NoXmlWhiteSpaceRequestTypes);
537 
538  //**** start LOGIN GATEWAY CODE ***//
539  // check cookieCode, sequence, userWithLock, and permissions access all in one shot!
540  {
541  userInfo.checkLock_ = StringMacros::inWildCardSet(
542  userInfo.requestType_, propertyStruct_.CheckUserLockRequestTypes);
543  userInfo.requireLock_ = StringMacros::inWildCardSet(
544  userInfo.requestType_, propertyStruct_.RequireUserLockRequestTypes);
545  userInfo.allowNoUser_ = StringMacros::inWildCardSet(
546  userInfo.requestType_, propertyStruct_.AllowNoLoginRequestTypes);
547 
548  userInfo.permissionsThreshold_ = -1; // default to max
549  try
550  {
551  userInfo.permissionsThreshold_ =
552  CorePropertySupervisorBase::getSupervisorPropertyUserPermissionsThreshold(
553  userInfo.requestType_);
554  }
555  catch(std::runtime_error& e)
556  {
557  if(!userInfo.automatedCommand_)
558  __SUP_COUT__ << "No explicit permissions threshold for request '"
559  << userInfo.requestType_
560  << "'... Defaulting to max threshold = "
561  << (unsigned int)userInfo.permissionsThreshold_ << __E__;
562  }
563 
564  // __COUTV__(userInfo.requestType_);
565  // __COUTV__(userInfo.checkLock_);
566  // __COUTV__(userInfo.requireLock_);
567  // __COUTV__(userInfo.allowNoUser_);
568  // __COUTV__((unsigned int)userInfo.permissionsThreshold_);
569 
570  try
571  {
572  StringMacros::getSetFromString(
573  StringMacros::getWildCardMatchFromMap(userInfo.requestType_,
574  propertyStruct_.UserGroupsAllowed),
575  userInfo.groupsAllowed_);
576  }
577  catch(std::runtime_error& e)
578  {
579  userInfo.groupsAllowed_.clear();
580 
581  // if(!userInfo.automatedCommand_)
582  // __SUP_COUT__ << "No explicit groups allowed for request '" <<
583  // userInfo.requestType_ << "'... Defaulting to empty groups
584  // allowed. " << __E__;
585  }
586  try
587  {
588  StringMacros::getSetFromString(
589  StringMacros::getWildCardMatchFromMap(
590  userInfo.requestType_, propertyStruct_.UserGroupsDisallowed),
591  userInfo.groupsDisallowed_);
592  }
593  catch(std::runtime_error& e)
594  {
595  userInfo.groupsDisallowed_.clear();
596 
597  // if(!userInfo.automatedCommand_)
598  // __SUP_COUT__ << "No explicit groups disallowed for request '"
599  //<<
600  // userInfo.requestType_ << "'... Defaulting to empty groups
601  // disallowed. " << __E__;
602  }
603  } //**** end LOGIN GATEWAY CODE ***//
604 
605  // completed user info, for the request type, is returned to caller
606 }
void init(xdaq::ApplicationContext *applicationContext)