本文整理汇总了C++中Owned::createUserScopes方法的典型用法代码示例。如果您正苦于以下问题:C++ Owned::createUserScopes方法的具体用法?C++ Owned::createUserScopes怎么用?C++ Owned::createUserScopes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owned
的用法示例。
在下文中一共展示了Owned::createUserScopes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
if(argc != 2)
{
printf("usage: addScopes daliconf.xml\n");
printf("\n\tCreates all user-specific LDAP private file scopes 'hpccinternal::<user>'\n\tand grants users access to their scope. The configuration file\n\tdaliconf.xml is the dali configuration file, typically\n\tfound in /var/lib/HPCCSystems/mydali\n\n");
return -1;
}
InitModuleObjects();
try
{
Owned<IPropertyTree> cfg = createPTreeFromXMLFile(argv[1]);
Owned<IPropertyTree> seccfg = cfg->getPropTree(".//ldapSecurity");
if(seccfg == NULL)
{
printf("ldapSecurity not found\n");
return -1;
}
#ifdef _NO_LDAP
printf("System was built with _NO_LDAP\n");
return -1;
#else
Owned<ISecManager> secmgr = newLdapSecManager("addScopes", *LINK(seccfg));
if(secmgr == NULL)
{
printf("Security manager can't be created\n");
return -1;
}
bool ok = secmgr->createUserScopes();
printf(ok ? "User scopes added\n" : "Some scopes not added\n");
#endif
}
catch(IException* e)
{
StringBuffer errmsg;
e->errorMessage(errmsg);
printf("%s\n", errmsg.str());
}
catch(...)
{
printf("Unknown exception\n");
}
releaseAtoms();
return 0;
}