本文整理汇总了C++中ISecResource::setDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ ISecResource::setDescription方法的具体用法?C++ ISecResource::setDescription怎么用?C++ ISecResource::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISecResource
的用法示例。
在下文中一共展示了ISecResource::setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeStringException
IAuthMap * CLocalSecurityManager::createAuthMap(IPropertyTree * authconfig)
{
CAuthMap* authmap = new CAuthMap(this);
IPropertyTreeIterator *loc_iter = NULL;
loc_iter = authconfig->getElements(".//Location");
if (loc_iter != NULL)
{
IPropertyTree *location = NULL;
loc_iter->first();
while(loc_iter->isValid())
{
location = &loc_iter->query();
if (location)
{
StringBuffer pathstr, rstr, required, description;
location->getProp("@path", pathstr);
location->getProp("@resource", rstr);
location->getProp("@required", required);
location->getProp("@description", description);
if(pathstr.length() == 0)
throw MakeStringException(-1, "path empty in Authenticate/Location");
if(rstr.length() == 0)
throw MakeStringException(-1, "resource empty in Authenticate/Location");
ISecResourceList* rlist = authmap->queryResourceList(pathstr.str());
if(rlist == NULL)
{
rlist = createResourceList("localsecurity");
authmap->add(pathstr.str(), rlist);
}
ISecResource* rs = rlist->addResource(rstr.str());
unsigned requiredaccess = str2perm(required.str());
rs->setRequiredAccessFlags(requiredaccess);
rs->setDescription(description.str());
}
loc_iter->next();
}
loc_iter->Release();
loc_iter = NULL;
}
return authmap;
}
示例2: MakeStringException
IAuthMap * createAuthMap(IPropertyTree * authconfig)
{
CAuthMap* authmap = new CAuthMap(this);
Owned<IPropertyTreeIterator> loc_iter;
loc_iter.setown(authconfig->getElements(".//Location"));
if (loc_iter)
{
IPropertyTree *location = NULL;
loc_iter->first();
while(loc_iter->isValid())
{
location = &loc_iter->query();
if (location)
{
StringBuffer pathstr, rstr, required, description;
location->getProp("@path", pathstr);
location->getProp("@resource", rstr);
location->getProp("@required", required);
location->getProp("@description", description);
if(pathstr.length() == 0)
throw MakeStringException(-1, "path empty in Authenticate/Location");
if(rstr.length() == 0)
throw MakeStringException(-1, "resource empty in Authenticate/Location");
ISecResourceList* rlist = authmap->queryResourceList(pathstr.str());
if(rlist == NULL)
{
rlist = createResourceList("htpasswdsecurity");
authmap->add(pathstr.str(), rlist);
}
ISecResource* rs = rlist->addResource(rstr.str());
SecAccessFlags requiredaccess = str2perm(required.str());
rs->setRequiredAccessFlags(requiredaccess);
rs->setDescription(description.str());
rs->setAccessFlags(SecAccess_Full);//grant full access to authenticated users
}
loc_iter->next();
}
}
return authmap;
}
示例3: createFeatureMap
IAuthMap * createFeatureMap(IPropertyTree * authconfig)
{
CAuthMap* feature_authmap = new CAuthMap(this);
Owned<IPropertyTreeIterator> feature_iter;
feature_iter.setown(authconfig->getElements(".//Feature"));
ForEach(*feature_iter)
{
IPropertyTree *feature = NULL;
feature = &feature_iter->query();
if (feature)
{
StringBuffer pathstr, rstr, required, description;
feature->getProp("@path", pathstr);
feature->getProp("@resource", rstr);
feature->getProp("@required", required);
feature->getProp("@description", description);
ISecResourceList* rlist = feature_authmap->queryResourceList(pathstr.str());
if(rlist == NULL)
{
rlist = createResourceList(pathstr.str());
feature_authmap->add(pathstr.str(), rlist);
}
if (!rstr.isEmpty())
{
ISecResource* rs = rlist->addResource(rstr.str());
SecAccessFlags requiredaccess = str2perm(required.str());
rs->setRequiredAccessFlags(requiredaccess);
rs->setDescription(description.str());
rs->setAccessFlags(SecAccess_Full);//grant full access to authenticated users
}
}
}
return feature_authmap;
}