summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authz_manager_external_state.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-05-23 13:17:22 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-05-28 16:13:48 -0400
commit0672061deb58aac931912bed68d014247c581968 (patch)
tree5ef08865cb578ee3f46995809b9ac6c7eb3e13df /src/mongo/db/auth/authz_manager_external_state.h
parentee3fb776c7f36d59b593db7e4165b0611a7a503f (diff)
downloadmongo-0672061deb58aac931912bed68d014247c581968.tar.gz
SERVER-13961 Pass LockState to DBWrite and DBRead directly
This is part of the changes to move LockState be part of OperationContext and not retrieved from TLS.
Diffstat (limited to 'src/mongo/db/auth/authz_manager_external_state.h')
-rw-r--r--src/mongo/db/auth/authz_manager_external_state.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mongo/db/auth/authz_manager_external_state.h b/src/mongo/db/auth/authz_manager_external_state.h
index f637415ae91..7c97eb5ea38 100644
--- a/src/mongo/db/auth/authz_manager_external_state.h
+++ b/src/mongo/db/auth/authz_manager_external_state.h
@@ -41,6 +41,8 @@
namespace mongo {
+ class OperationContext;
+
/**
* Public interface for a class that encapsulates all the information related to system
* state not stored in AuthorizationManager. This is primarily to make AuthorizationManager
@@ -64,7 +66,7 @@ namespace mongo {
* Retrieves the schema version of the persistent data describing users and roles.
* Will leave *outVersion unmodified on non-OK status return values.
*/
- virtual Status getStoredAuthorizationVersion(int* outVersion) = 0;
+ virtual Status getStoredAuthorizationVersion(OperationContext* txn, int* outVersion) = 0;
/**
* Writes into "result" a document describing the named user and returns Status::OK(). The
@@ -76,7 +78,8 @@ namespace mongo {
*
* If the user does not exist, returns ErrorCodes::UserNotFound.
*/
- virtual Status getUserDescription(const UserName& userName, BSONObj* result) = 0;
+ virtual Status getUserDescription(
+ OperationContext* txn, const UserName& userName, BSONObj* result) = 0;
/**
* Writes into "result" a document describing the named role and returns Status::OK(). The
@@ -119,13 +122,15 @@ namespace mongo {
* On success, returns Status::OK() and stores a shared-ownership copy of the document into
* "result".
*/
- Status getPrivilegeDocumentV1(
- const StringData& dbname, const UserName& userName, BSONObj* result);
+ Status getPrivilegeDocumentV1(OperationContext* txn,
+ const StringData& dbname,
+ const UserName& userName,
+ BSONObj* result);
/**
* Returns true if there exists at least one privilege document in the system.
*/
- bool hasAnyPrivilegeDocuments();
+ bool hasAnyPrivilegeDocuments(OperationContext* txn);
/**
* Creates the given user object in the given database.
@@ -164,7 +169,8 @@ namespace mongo {
* Returns Status::OK() on success. If no match is found, returns
* ErrorCodes::NoMatchingDocument. Other errors returned as appropriate.
*/
- virtual Status findOne(const NamespaceString& collectionName,
+ virtual Status findOne(OperationContext* txn,
+ const NamespaceString& collectionName,
const BSONObj& query,
BSONObj* result) = 0;