summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r--src/mongo/db/commands.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index 3f2346fe926..86fbec22161 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -148,6 +148,11 @@ public:
virtual bool shouldAffectCommandCounter() const = 0;
/**
+ * Return true if the command requires auth.
+ */
+ virtual bool requiresAuth() const = 0;
+
+ /**
* Generates help text for this command.
*/
virtual void help(std::stringstream& help) const = 0;
@@ -302,6 +307,10 @@ public:
return true;
}
+ bool requiresAuth() const override {
+ return true;
+ }
+
void help(std::stringstream& help) const override;
Status explain(OperationContext* opCtx,