summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_session_impl.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2021-02-05 14:00:41 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-09 00:04:28 +0000
commit93bddb471583e84afc412b68c7e9c06871d42c43 (patch)
treea42ee943c596d6c0d203a4a4730980591f0b1189 /src/mongo/db/auth/authorization_session_impl.h
parent3120087175678ec7a61a6d12cd9326ba8cfa2d45 (diff)
downloadmongo-93bddb471583e84afc412b68c7e9c06871d42c43.tar.gz
SERVER-54022 Simplify AuthorizationSession
Diffstat (limited to 'src/mongo/db/auth/authorization_session_impl.h')
-rw-r--r--src/mongo/db/auth/authorization_session_impl.h47
1 files changed, 2 insertions, 45 deletions
diff --git a/src/mongo/db/auth/authorization_session_impl.h b/src/mongo/db/auth/authorization_session_impl.h
index df74157aebc..598c05d5239 100644
--- a/src/mongo/db/auth/authorization_session_impl.h
+++ b/src/mongo/db/auth/authorization_session_impl.h
@@ -30,7 +30,6 @@
#pragma once
#include <memory>
-#include <string>
#include <vector>
#include "mongo/base/status.h"
@@ -42,7 +41,6 @@
#include "mongo/db/auth/user_name.h"
#include "mongo/db/auth/user_set.h"
#include "mongo/db/namespace_string.h"
-#include "mongo/db/pipeline/aggregate_command_gen.h"
namespace mongo {
@@ -80,6 +78,8 @@ public:
User* lookupUser(const UserName& name) override;
+ bool shouldIgnoreAuthChecks() override;
+
bool isAuthenticated() override;
User* getSingleUser() override;
@@ -96,44 +96,9 @@ public:
PrivilegeVector getDefaultPrivileges() override;
- Status checkAuthForFind(const NamespaceString& ns, bool hasTerm) override;
-
- Status checkAuthForGetMore(const NamespaceString& ns,
- long long cursorID,
- bool hasTerm) override;
-
- Status checkAuthForUpdate(OperationContext* opCtx,
- const NamespaceString& ns,
- const BSONObj& query,
- const write_ops::UpdateModification& update,
- bool upsert) override;
-
- Status checkAuthForInsert(OperationContext* opCtx, const NamespaceString& ns) override;
-
- Status checkAuthForDelete(OperationContext* opCtx,
- const NamespaceString& ns,
- const BSONObj& query) override;
-
- Status checkAuthForKillCursors(const NamespaceString& cursorNss,
- UserNameIterator cursorOwner) override;
-
- StatusWith<PrivilegeVector> getPrivilegesForAggregate(const NamespaceString& ns,
- const AggregateCommand& request,
- bool isMongos) override;
-
- Status checkAuthForCreate(const CreateCommand& cmd, bool isMongos) override;
-
- Status checkAuthForCollMod(const NamespaceString& ns,
- const BSONObj& cmdObj,
- bool isMongos) override;
-
StatusWith<PrivilegeVector> checkAuthorizedToListCollections(StringData dbname,
const BSONObj& cmdObj) override;
- Status checkAuthorizedToGrantPrivilege(const Privilege& privilege) override;
-
- Status checkAuthorizedToRevokePrivilege(const Privilege& privilege) override;
-
bool isUsingLocalhostBypass() override;
bool isAuthorizedToParseNamespaceElement(const BSONElement& elem) override;
@@ -142,16 +107,8 @@ public:
bool isAuthorizedToCreateRole(const RoleName& roleName) override;
- bool isAuthorizedToGrantRole(const RoleName& role) override;
-
- bool isAuthorizedToRevokeRole(const RoleName& role) override;
-
bool isAuthorizedToChangeAsUser(const UserName& userName, ActionType actionType) override;
- bool isAuthorizedToChangeOwnPasswordAsUser(const UserName& userName) override;
-
- bool isAuthorizedToChangeOwnCustomDataAsUser(const UserName& userName) override;
-
bool isAuthenticatedAsUserWithRole(const RoleName& roleName) override;
bool isAuthorizedForPrivilege(const Privilege& privilege) override;