diff options
author | James Wahlin <james@mongodb.com> | 2017-07-03 15:33:36 -0400 |
---|---|---|
committer | James Wahlin <james@mongodb.com> | 2017-07-25 12:24:49 -0400 |
commit | 5dcaad5f137eebc1915c0fc7b5078da4aa86f915 (patch) | |
tree | 3994b41708bce7cf5cbc5b7c9ba422db77f9bfb3 /src/mongo/db/pipeline/lite_parsed_pipeline.h | |
parent | 079763d2cd06776edf81f3ecf6c32ab66d1742ec (diff) | |
download | mongo-5dcaad5f137eebc1915c0fc7b5078da4aa86f915.tar.gz |
SERVER-29371 DocumentSource classes should provide auth requirements
Diffstat (limited to 'src/mongo/db/pipeline/lite_parsed_pipeline.h')
-rw-r--r-- | src/mongo/db/pipeline/lite_parsed_pipeline.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/lite_parsed_pipeline.h b/src/mongo/db/pipeline/lite_parsed_pipeline.h index ca2e9dfda77..07e5c947cc3 100644 --- a/src/mongo/db/pipeline/lite_parsed_pipeline.h +++ b/src/mongo/db/pipeline/lite_parsed_pipeline.h @@ -72,6 +72,19 @@ public: } /** + * Returns a list of the priviliges required for this pipeline. + */ + PrivilegeVector requiredPrivileges(bool isMongos) const { + PrivilegeVector requiredPrivileges; + for (auto&& spec : _stageSpecs) { + Privilege::addPrivilegesToPrivilegeVector(&requiredPrivileges, + spec->requiredPrivileges(isMongos)); + } + + return requiredPrivileges; + } + + /** * Returns true if the pipeline begins with a $collStats stage. */ bool startsWithCollStats() const { |