otsdaq  v2_04_02
CorePropertySupervisorBase.cc
1 #include "otsdaq/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  CorePropertySupervisorBase::setSupervisorProperty(
231  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.RequireSecurityRequestTypes,
232  "");
233 
234  CorePropertySupervisorBase::setSupervisorProperty(
235  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.NoXmlWhiteSpaceRequestTypes,
236  "");
237  CorePropertySupervisorBase::setSupervisorProperty(
238  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.NonXMLRequestTypes, "");
239 
240  // __SUP_COUT__ << "Done setting up Core Supervisor Base property defaults for
241  // supervisor" <<
242  // "..." << __E__;
243 } // end setSupervisorPropertyDefaults()
244 
245 //========================================================================================================================
246 // extractPermissionsMapFromString
247 // Static function that extract map function to standardize approach
248 // in case needed by supervisors for special permissions handling.
249 // For example, used to serve Desktop Icons.
250 //
251 // permissionsString format is as follows:
252 // <groupName>:<permissionsThreshold> pairs separated by ',' '&' or '|'
253 // for example, to give access admins and pixel team but not calorimeter team:
254 // allUsers:255 | pixelTeam:1 | calorimeterTeam:0
255 //
256 // Use with CorePropertySupervisorBase::doPermissionsGrantAccess to determine
257 // if access is allowed.
258 void CorePropertySupervisorBase::extractPermissionsMapFromString(
259  const std::string& permissionsString,
260  std::map<std::string, WebUsers::permissionLevel_t>& permissionsMap)
261 {
262  permissionsMap.clear();
263  StringMacros::getMapFromString(permissionsString, permissionsMap);
264 }
265 
266 //========================================================================================================================
267 // doPermissionsGrantAccess
268 // Static function that checks permissionLevelsMap against permissionThresholdsMap and
269 // returns true if access requirements are met.
270 //
271 // This is useful in standardizing approach for supervisors in case of
272 // of special permissions handling.
273 // For example, used to serve Desktop Icons.
274 //
275 // permissionLevelsString format is as follows:
276 // <groupName>:<permissionsLevel> pairs separated by ',' '&' or '|'
277 // for example, to be a standard user and an admin on the pixel team and no access to
278 // calorimeter team: allUsers:1 | pixelTeam:255 | calorimeterTeam:0
279 //
280 // permissionThresoldsString format is as follows:
281 // <groupName>:<permissionsThreshold> pairs separated by ',' '&' or '|'
282 // for example, to give access admins and pixel team but not calorimeter team:
283 // allUsers:255 | pixelTeam:1 | calorimeterTeam:0
284 bool CorePropertySupervisorBase::doPermissionsGrantAccess(
285  std::map<std::string, WebUsers::permissionLevel_t>& permissionLevelsMap,
286  std::map<std::string, WebUsers::permissionLevel_t>& permissionThresholdsMap)
287 {
288  // return true if a permission level group name is found with a permission level
289  // greater than or equal to the permission level at a matching group name entry in
290  // the thresholds map.
291 
292  //__COUTV__(StringMacros::mapToString(permissionLevelsMap));
293  //__COUTV__(StringMacros::mapToString(permissionThresholdsMap));
294 
295  for(const auto& permissionLevelGroupPair : permissionLevelsMap)
296  {
297  //__COUTV__(permissionLevelGroupPair.first);
298  //__COUTV__(permissionLevelGroupPair.second);
299 
300  for(const auto& permissionThresholdGroupPair : permissionThresholdsMap)
301  {
302  //__COUTV__(permissionThresholdGroupPair.first);
303  //__COUTV__(permissionThresholdGroupPair.second);
304  if(permissionLevelGroupPair.first == permissionThresholdGroupPair.first &&
305  permissionThresholdGroupPair.second && // not explicitly disallowed
306  permissionLevelGroupPair.second >= permissionThresholdGroupPair.second)
307  return true; // access granted!
308  }
309  }
310  //__COUT__ << "Denied." << __E__;
311 
312  // if here, no access group match found
313  // so denied
314  return false;
315 } // end doPermissionsGrantAccess
316 
317 //========================================================================================================================
318 void CorePropertySupervisorBase::checkSupervisorPropertySetup()
319 {
320  if(propertiesAreSetup_)
321  return;
322 
323  // Immediately mark properties as setup, (prevent infinite loops due to
324  // other launches from within this function, e.g. from getSupervisorProperty)
325  // only redo if Context configuration group changes
326  propertiesAreSetup_ = true;
327 
328  CorePropertySupervisorBase::setSupervisorPropertyDefaults(); // calls base class
329  // version defaults
330 
331  //__SUP_COUT__ << "Setting up supervisor specific property DEFAULTS for supervisor..."
332  //<< __E__;
333  setSupervisorPropertyDefaults(); // calls override version defaults
334  // __SUP_COUT__ << "Done setting up supervisor
335  // specific property DEFAULTS for supervisor" <<
336  // "." << __E__;
337 
338  if(allSupervisorInfo_.isWizardMode())
339  __SUP_COUT__ << "Wiz mode detected. Skipping setup of supervisor properties for "
340  "supervisor of class '"
341  << supervisorClass_ << "'" << __E__;
342  else if(allSupervisorInfo_.isMacroMakerMode())
343  __SUP_COUT__
344  << "Maker Maker mode detected. Skipping setup of supervisor properties for "
345  "supervisor of class '"
346  << supervisorClass_ << "'" << __E__;
347  else
348  CorePropertySupervisorBase::loadUserSupervisorProperties(); // loads user
349  // settings from
350  // configuration
351 
352  //__SUP_COUT__ << "Setting up supervisor specific FORCED properties for supervisor..."
353  //<< __E__;
354  forceSupervisorPropertyValues(); // calls override forced values
355  // __SUP_COUT__ << "Done setting up supervisor
356  // specific FORCED properties for supervisor" <<
357  // "." << __E__;
358 
359  CorePropertySupervisorBase::extractPermissionsMapFromString(
360  getSupervisorProperty(
361  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserPermissionsThreshold),
362  propertyStruct_.UserPermissionsThreshold);
363 
364  propertyStruct_.UserGroupsAllowed.clear();
365  StringMacros::getMapFromString(
366  getSupervisorProperty(
367  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserGroupsAllowed),
368  propertyStruct_.UserGroupsAllowed);
369 
370  propertyStruct_.UserGroupsDisallowed.clear();
371  StringMacros::getMapFromString(
372  getSupervisorProperty(
373  CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserGroupsDisallowed),
374  propertyStruct_.UserGroupsDisallowed);
375 
376  auto nameIt = SUPERVISOR_PROPERTIES.allSetNames_.begin();
377  auto setIt = propertyStruct_.allSets_.begin();
378  while(nameIt != SUPERVISOR_PROPERTIES.allSetNames_.end() &&
379  setIt != propertyStruct_.allSets_.end())
380  {
381  (*setIt)->clear();
382  StringMacros::getSetFromString(getSupervisorProperty(*(*nameIt)), *(*setIt));
383 
384  ++nameIt;
385  ++setIt;
386  }
387 
388  __SUP_COUT__ << "Final supervisor property settings:" << __E__;
389  for(auto& property : propertyMap_)
390  __SUP_COUT__ << "\t" << property.first << " = " << property.second << __E__;
391 }
392 
393 //========================================================================================================================
394 // getSupervisorTreeNode ~
395 // try to get this Supervisors configuration tree node
396 ConfigurationTree CorePropertySupervisorBase::getSupervisorTreeNode(void) try
397 {
398  if(supervisorContextUID_ == "" || supervisorApplicationUID_ == "")
399  {
400  __SUP_SS__ << "Empty supervisorContextUID_ or supervisorApplicationUID_."
401  << __E__;
402  __SUP_SS_THROW__;
403  }
404  return theConfigurationManager_->getSupervisorNode(supervisorContextUID_,
405  supervisorApplicationUID_);
406 }
407 catch(...)
408 {
409  __SUP_COUT_ERR__
410  << "XDAQ Supervisor could not access it's configuration node through "
411  "theConfigurationManager_ "
412  << "(Did you remember to initialize using CorePropertySupervisorBase::init()?)."
413  << " The supervisorContextUID_ = " << supervisorContextUID_
414  << ". The supervisorApplicationUID = " << supervisorApplicationUID_ << __E__;
415  throw;
416 }
417 
418 //========================================================================================================================
419 // loadUserSupervisorProperties ~
420 // try to get user supervisor properties
421 void CorePropertySupervisorBase::loadUserSupervisorProperties(void)
422 {
423  // __SUP_COUT__ << "Loading user properties for supervisor '" <<
424  // supervisorContextUID_ << "/" << supervisorApplicationUID_ <<
425  // "'..." << __E__;
426 
427  // re-acquire the configuration supervisor node, in case the config has changed
428  auto supervisorNode = CorePropertySupervisorBase::getSupervisorTreeNode();
429 
430  try
431  {
432  auto /*map<name,node>*/ children =
433  supervisorNode.getNode("LinkToPropertyTable").getChildren();
434 
435  for(auto& child : children)
436  {
437  if(child.second.getNode("Status").getValue<bool>() == false)
438  continue; // skip OFF properties
439 
440  auto propertyName = child.second.getNode("PropertyName").getValue();
441  setSupervisorProperty(
442  propertyName,
443  child.second.getNode("PropertyValue").getValue<std::string>());
444  }
445  }
446  catch(...)
447  {
448  __SUP_COUT__ << "No user supervisor property settings found in the configuration "
449  "tree, going with the defaults."
450  << __E__;
451  }
452 
453  // __SUP_COUT__ << "Done loading user properties for supervisor '" <<
454  // supervisorContextUID_ << "/" << supervisorApplicationUID_ <<
455  // "'" << __E__;
456 }
457 
458 //========================================================================================================================
459 void CorePropertySupervisorBase::setSupervisorProperty(const std::string& propertyName,
460  const std::string& propertyValue)
461 {
462  propertyMap_[propertyName] = propertyValue;
463  // __SUP_COUT__ << "Set propertyMap_[" << propertyName <<
464  // "] = " << propertyMap_[propertyName] << __E__;
465 }
466 
467 //========================================================================================================================
468 void CorePropertySupervisorBase::addSupervisorProperty(const std::string& propertyName,
469  const std::string& propertyValue)
470 {
471  propertyMap_[propertyName] =
472  propertyValue + " | " + getSupervisorProperty(propertyName);
473  // __SUP_COUT__ << "Set propertyMap_[" << propertyName <<
474  // "] = " << propertyMap_[propertyName] << __E__;
475 }
476 
477 //========================================================================================================================
478 // getSupervisorProperty
479 // string version of template function
480 std::string CorePropertySupervisorBase::getSupervisorProperty(
481  const std::string& propertyName)
482 {
483  // check if need to setup properties
484  checkSupervisorPropertySetup();
485 
486  auto it = propertyMap_.find(propertyName);
487  if(it == propertyMap_.end())
488  {
489  __SUP_SS__ << "Could not find property named " << propertyName << __E__;
490  __SS_THROW__; //__SUP_SS_THROW__;
491  }
492  return StringMacros::validateValueForDefaultStringDataType(it->second);
493 }
494 
495 std::string CorePropertySupervisorBase::getSupervisorProperty(
496  const std::string& propertyName, const std::string& defaultValue)
497 {
498  // check if need to setup properties
499  checkSupervisorPropertySetup();
500 
501  auto it = propertyMap_.find(propertyName);
502  if(it == propertyMap_.end())
503  {
504  // not found, so returning default value
505  return defaultValue;
506  }
507  return StringMacros::validateValueForDefaultStringDataType(it->second);
508 }
509 
510 //========================================================================================================================
511 // getSupervisorPropertyUserPermissionsThreshold
512 // returns the threshold based on the requestType
513 WebUsers::permissionLevel_t
514 CorePropertySupervisorBase::getSupervisorPropertyUserPermissionsThreshold(
515  const std::string& requestType)
516 {
517  // check if need to setup properties
518  checkSupervisorPropertySetup();
519 
520  return StringMacros::getWildCardMatchFromMap(
521  requestType, propertyStruct_.UserPermissionsThreshold);
522 
523  // auto it = propertyStruct_.UserPermissionsThreshold.find(requestType);
524  // if(it == propertyStruct_.UserPermissionsThreshold.end())
525  // {
526  // __SUP_SS__ << "Could not find requestType named " << requestType << " in
527  // UserPermissionsThreshold map." << __E__;
528  // __SS_THROW__; //__SUP_SS_THROW__;
529  // }
530  // return it->second;
531 }
532 
533 //========================================================================================================================
534 // getRequestUserInfo ~
535 // extract user info for request based on property configuration
536 void CorePropertySupervisorBase::getRequestUserInfo(WebUsers::RequestUserInfo& userInfo)
537 {
538  checkSupervisorPropertySetup();
539 
540  //__SUP_COUT__ << "userInfo.requestType_ " << userInfo.requestType_ << " files: " <<
541  // cgiIn.getFiles().size() << __E__;
542 
543  userInfo.automatedCommand_ = StringMacros::inWildCardSet(
544  userInfo.requestType_,
545  propertyStruct_.AutomatedRequestTypes); // automatic commands should not refresh
546  // cookie code.. only user initiated
547  // commands should!
548  userInfo.NonXMLRequestType_ = StringMacros::inWildCardSet(
549  userInfo.requestType_, propertyStruct_.NonXMLRequestTypes); // non-xml request
550  // types just return
551  // the request return
552  // string to client
553  userInfo.NoXmlWhiteSpace_ = StringMacros::inWildCardSet(
554  userInfo.requestType_, propertyStruct_.NoXmlWhiteSpaceRequestTypes);
555 
556  //**** start LOGIN GATEWAY CODE ***//
557  // check cookieCode, sequence, userWithLock, and permissions access all in one shot!
558  {
559  userInfo.checkLock_ = StringMacros::inWildCardSet(
560  userInfo.requestType_, propertyStruct_.CheckUserLockRequestTypes);
561  userInfo.requireLock_ = StringMacros::inWildCardSet(
562  userInfo.requestType_, propertyStruct_.RequireUserLockRequestTypes);
563  userInfo.allowNoUser_ = StringMacros::inWildCardSet(
564  userInfo.requestType_, propertyStruct_.AllowNoLoginRequestTypes);
565  userInfo.requireSecurity_ = StringMacros::inWildCardSet(
566  userInfo.requestType_, propertyStruct_.RequireSecurityRequestTypes);
567 
568  userInfo.permissionsThreshold_ = -1; // default to max
569  try
570  {
571  userInfo.permissionsThreshold_ =
572  CorePropertySupervisorBase::getSupervisorPropertyUserPermissionsThreshold(
573  userInfo.requestType_);
574  }
575  catch(std::runtime_error& e)
576  {
577  if(!userInfo.automatedCommand_)
578  __SUP_COUT__ << "No explicit permissions threshold for request '"
579  << userInfo.requestType_
580  << "'... Defaulting to max threshold = "
581  << (unsigned int)userInfo.permissionsThreshold_ << __E__;
582  }
583 
584  // __COUTV__(userInfo.requestType_);
585  // __COUTV__(userInfo.checkLock_);
586  // __COUTV__(userInfo.requireLock_);
587  // __COUTV__(userInfo.allowNoUser_);
588  // __COUTV__((unsigned int)userInfo.permissionsThreshold_);
589 
590  try
591  {
592  StringMacros::getSetFromString(
593  StringMacros::getWildCardMatchFromMap(userInfo.requestType_,
594  propertyStruct_.UserGroupsAllowed),
595  userInfo.groupsAllowed_);
596  }
597  catch(std::runtime_error& e)
598  {
599  userInfo.groupsAllowed_.clear();
600 
601  // if(!userInfo.automatedCommand_)
602  // __SUP_COUT__ << "No explicit groups allowed for request '" <<
603  // userInfo.requestType_ << "'... Defaulting to empty groups
604  // allowed. " << __E__;
605  }
606  try
607  {
608  StringMacros::getSetFromString(
609  StringMacros::getWildCardMatchFromMap(
610  userInfo.requestType_, propertyStruct_.UserGroupsDisallowed),
611  userInfo.groupsDisallowed_);
612  }
613  catch(std::runtime_error& e)
614  {
615  userInfo.groupsDisallowed_.clear();
616 
617  // if(!userInfo.automatedCommand_)
618  // __SUP_COUT__ << "No explicit groups disallowed for request '"
619  //<<
620  // userInfo.requestType_ << "'... Defaulting to empty groups
621  // disallowed. " << __E__;
622  }
623  } //**** end LOGIN GATEWAY CODE ***//
624 
625  // completed user info, for the request type, is returned to caller
626 }