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