Ejemplo n.º 1
0
 Status V2UserDocumentParser::checkValidRoleObject(const BSONObj& roleObject) {
     BSONElement roleNameElement;
     BSONElement roleSourceElement;
     return _extractRoleDocumentElements(
             roleObject,
             &roleNameElement,
             &roleSourceElement);
 }
Ejemplo n.º 2
0
Status V2UserDocumentParser::parseRoleName(const BSONObj& roleObject, RoleName* result) {
    BSONElement roleNameElement;
    BSONElement roleSourceElement;
    Status status = _extractRoleDocumentElements(roleObject, &roleNameElement, &roleSourceElement);
    if (!status.isOK())
        return status;
    *result = RoleName(roleNameElement.str(), roleSourceElement.str());
    return status;
}
Ejemplo n.º 3
0
 Status V2UserDocumentParser::checkValidRoleObject(
         const BSONObj& roleObject, bool hasPossessionBools) {
     BSONElement roleNameElement;
     BSONElement roleSourceElement;
     BSONElement canDelegateElement;
     BSONElement hasRoleElement;
     return _extractRoleDocumentElements(
             roleObject,
             hasPossessionBools,
             &roleNameElement,
             &roleSourceElement,
             &canDelegateElement,
             &hasRoleElement);
 }
Ejemplo n.º 4
0
 Status V2UserDocumentParser::parseRoleData(const BSONObj& roleObject, User::RoleData* result) {
     BSONElement roleNameElement;
     BSONElement roleSourceElement;
     BSONElement canDelegateElement;
     BSONElement hasRoleElement;
     Status status =  _extractRoleDocumentElements(
             roleObject,
             &roleNameElement,
             &roleSourceElement,
             &canDelegateElement,
             &hasRoleElement);
     if (!status.isOK())
         return status;
     result->name = RoleName(roleNameElement.str(), roleSourceElement.str());
     result->canDelegate = canDelegateElement.eoo() ? false : canDelegateElement.trueValue();
     result->hasRole = hasRoleElement.eoo() ? true : hasRoleElement.trueValue();
     return status;
 }